in reply to taking memory snapshots with perl

"without using a (non-portable) system call?"

For *NIX-based systems, I strongly recommend the usage of Proc::ProcessTable which I have reviewed previously on this site here - This module however is not portable to Windows as it relies upon information derived from /proc/XXX/stat files (much nicer than parsing ps output). Without resorting to much XS magic, I believe that this would be your best bet - I would welcome correction on this with a link or example :-)

Example usage of Proc::ProcessTable to determine a processes own memory utilisation, as either a definite size or a memory percentage, posted by myself can be at this node.

 

perl -e 's&&rob@cowsnet.com.au&&&split/[@.]/&&s&.com.&_&&&print'