Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

Answer: Determining memory usage of a process...

by Zaxo (Archbishop)
on Sep 28, 2001 at 09:32 UTC ( #115324=categorized answer: print w/replies, xml ) Need Help??

Q&A > programs and processes > Determining memory usage of a process... - Answer contributed by Zaxo

On Linux (since h option differs from BSD),

my $sz = `ps h -o sz $$`;
Other ps stats can be gotten similarly. It uses the rich ps system call for process stats, see 'man ps'. Perl's $$ variable is the current pid.

Another approach is to root around in the "/proc/$$/" or '/proc/self/' directory.

Log In?

What's my password?
Create A New User
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (3)
As of 2016-10-28 03:52 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (375 votes). Check out past polls.