I have a C++ application that needs to know how much virtual memory it
is using. If it comes close to a certain max (e.g. 2GB) then it needs
to run its own garbage collection routines (to prevent it from crashing).
What's the best way to find out the current virtual memory usage? Is it
reasonable to read the /proc/<pid>/stat file and take the 23rd column
which reports the virtual memory size?
Or is there a better/faster way to find the information? Maybe a C++
function call (linux)?
Thanks!
Markus
|
|
0
|
|
|
|
Reply
|
Markus
|
11/24/2005 4:52:17 PM |
|