Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Determining memory usage of a process...

by Zaxo (Archbishop)
on Sep 28, 2001 at 09:32 UTC ( [id://115324]=note: print w/replies, xml ) Need Help??


in reply to Determining memory usage of a process...

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?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://115324]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (2)
As of 2024-05-24 02:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found