(plugin) os::linux::local - mode process inacurrate memory usage (#4529)

This commit is contained in:
qgarnier 2023-07-25 15:44:51 +02:00 committed by GitHub
parent 9f778ed15b
commit aff7824430
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -295,7 +295,7 @@ sub add_memory {
next if ($options{content} !~ /==>\s*\/proc\/$pid\/statm.*?\n(.*?)(?:==>|\Z)/ms); next if ($options{content} !~ /==>\s*\/proc\/$pid\/statm.*?\n(.*?)(?:==>|\Z)/ms);
my @values = split(/\s+/, $1); my @values = split(/\s+/, $1);
my $memory_used = ($values[1] * $self->{option_results}->{page_size}) + ($values[5] * $self->{option_results}->{page_size}); my $memory_used = ($values[1] * $self->{option_results}->{page_size});
$self->{processes}->{$pid}->{memory_used} = $memory_used; $self->{processes}->{$pid}->{memory_used} = $memory_used;
$self->{global}->{memory_used} += $memory_used; $self->{global}->{memory_used} += $memory_used;
} }