|
From: Peter S. <Pet...@me...> - 2005-06-17 13:46:34
|
Hi, In my console program (C++), massif reports a top usage of 350KB heap+stack and a steady-state usage of only 50KB. ( See <http://people.mech.kuleuven.ac.be/~psoetens/tmp/massif.17647.ps> ) But looking at /proc/pid/status, I get : Name: taskintro State: S (sleeping) SleepAVG: 58% Tgid: 18314 Pid: 18314 PPid: 5599 TracerPid: 0 Uid: 1000 1000 1000 1000 Gid: 1000 1000 1000 1000 FDSize: 256 Groups: 6 24 25 29 33 44 100 101 103 108 1000 VmSize: 41832 kB VmLck: 41832 kB VmRSS: 41828 kB VmData: 33240 kB VmStk: 84 kB VmExe: 2020 kB VmLib: 5440 kB VmPTE: 68 kB Threads: 5 ... Is it possible that massif does not check all threads ? From the manual I understood that massif reports every byte (approximately) heaped and alloced, but VmData is supposed to be the apps' allocated data. So what explains the difference ? Is the memory still present in a std::allocator or so ? Is there a better metric ? Could not find this on the website/faq or in the archive. Peter Soetens |
|
From: Nicholas N. <nj...@cs...> - 2005-06-17 15:09:03
|
On Fri, 17 Jun 2005, Peter Soetens wrote: > In my console program (C++), massif reports a top usage of 350KB heap+stack > and a steady-state usage of only 50KB. > ( See <http://people.mech.kuleuven.ac.be/~psoetens/tmp/massif.17647.ps> ) > > But looking at /proc/pid/status, I get : > Name: taskintro > State: S (sleeping) > SleepAVG: 58% > Tgid: 18314 > Pid: 18314 > PPid: 5599 > TracerPid: 0 > Uid: 1000 1000 1000 1000 > Gid: 1000 1000 1000 1000 > FDSize: 256 > Groups: 6 24 25 29 33 44 100 101 103 108 1000 > VmSize: 41832 kB > VmLck: 41832 kB > VmRSS: 41828 kB > VmData: 33240 kB > VmStk: 84 kB > VmExe: 2020 kB > VmLib: 5440 kB > VmPTE: 68 kB > Threads: 5 > ... > > Is it possible that massif does not check all threads ? From the manual I > understood that massif reports every byte (approximately) heaped and > alloced, but VmData is supposed to be the apps' allocated data. So what > explains the difference ? Is the memory still present > in a std::allocator or so ? Is there a better metric ? Memory consumption can be broadly categorised as heap + stack + static. Massif only reports heap + stack. Static includes almost everything that gets mmap'd in, including all code segments and static data segments. That explains the difference. Why doesn't Massif measure the static memory? It did, early on, but the figures are difficult to interpret because static memory can be shared between multiple processes on the same machine. Nick |