This small snippet is just an example of what your mighty
/proc filesystem in Linux can do for you. They report the
vsize (allocated virtual memory) of your perl process inclusive
all data it allocated and the number of pages your process
uses.
Of course you may just get the byte number for vsize and soopen( STAT , "</proc/$$/stat" ) or die "Unable to open stat file"; @stat = split /\s+/ , <STAT>; close( STAT ); print sprintf "Vsize: %3.2f MB\n", $stat[22]/1048576; print "RSS : $stat[23] pages\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: /proc Gimmicks (Linux specific)
by Zaxo (Archbishop) on Jul 16, 2001 at 05:08 UTC | |
|
Re: /proc Gimmicks (Linux specific)
by premchai21 (Curate) on Jul 16, 2001 at 13:26 UTC |