get virtual memory size of process?

  • Follow


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


0 Replies
589 Views

(page loaded in 0.018 seconds)

Similiar Articles:













7/22/2012 1:45:20 AM


Reply: