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

Re: Determining the Memory Usage of a Perl program from within Perl

by Gloom (Monk)
on Feb 15, 2001 at 16:31 UTC ( #58602=note: print w/ replies, xml ) Need Help??


in reply to Determining the Memory Usage of a Perl program from within Perl

Try

open( STAT , "</proc/$$/stat" ) or die "Unable to open stat file"; @stat = split /\s+/ , <STAT>; close( STAT );

You can find fields's description in man 5 proc

_______________
Hope this helps


Comment on Re: Determining the Memory Usage of a Perl program from within Perl
Select or Download Code
Replies are listed 'Best First'.
Re: Re: Determining the Memory Usage of a Perl program from within Perl
by snafu (Chaplain) on Apr 25, 2001 at 18:35 UTC
    The Linux /proc fs is pretty nice because all of the data there (or what I found in there) is ascii readable. However, anyone know how to parse out the binary data in the Solaris /proc fs? I have never ever ever done any kind of parsing of data (non-ascii) in my life and while I know the basic I idea behind it I have no idea how to do it in Perl (or any other language for that matter :). Perhaps a few pointers? I have a feeling that it can be done with the '&' bitwise operator (I saw a script that did it that way one time) but I believe you need the offset for that to work?? I dunno. Any help on this subject would be quite appreciated.

    ----------
    - Jim

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (13)
As of 2015-07-30 23:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (273 votes), past polls