linux:process memory use.

On linux distinguish between memory size and virtual memory size.
This commit is contained in:
Alastair Poole 2020-04-25 21:38:11 +01:00
parent 40eace5c54
commit 51d3977a9d
1 changed files with 1 additions and 1 deletions

View File

@ -157,7 +157,7 @@ _mem_size(Proc_Info *proc, int pid)
if (sscanf(buf, "%u %u %u %u %u %u %u", &size, &resident, &shared, &text,
&dummy, &data, &dummy) == 7)
{
proc->mem_size = data * getpagesize();
proc->mem_size = (text + shared + data) * getpagesize();
proc->mem_shared = shared * getpagesize();
}
}