Ovid has asked for the wisdom of the Perl Monks concerning the following question:

Assuming that I don't want to recompile Perl with -DDEBUGGING_MSTATS, what's the easiest way to determine memory usage on RH9 Linux (RAM and swap)? Is it to manually read the /proc/$$/statm file?

I'm playing around with tail recursion techniques and it looks like goto &code is leaking memory. This appears to be a known issue, even though perl561delta lists this problem as fixed and I'm using 5.8.0 (yeah, I know. I need to upgrade).

Cheers,
Ovid

New address of my CGI Course.

Replies are listed 'Best First'.
Re: Tracking Memory Usage
by adrianh (Chancellor) on Mar 28, 2004 at 19:53 UTC
    what's the easiest way to determine memory usage

    The memory profiling thread covered several alternatives.

      Sheesh. Just a couple of days ago and I still missed it. I should stop being such a stranger :)

      Cheers,
      Ovid

      New address of my CGI Course.

Re: Tracking Memory Usage
by zentara (Cardinal) on Mar 28, 2004 at 19:31 UTC
    easiest way to determine memory usage on RH9 Linux (RAM and swap)? Is it to manually read the /proc/$$/statm file?

    That's what I found. Proc::ProcessTable is useful but it cycles thru all the pids everytime you want to update, which isn't a leak, but it's alot of overhead.


    I'm not really a human, but I play one on earth. flash japh
Re: Tracking Memory Usage
by strat (Canon) on Mar 29, 2004 at 11:38 UTC

    Perhaps GTop might be what you are looking for. e.g. under mod_perl I use it to find out about the shared memory size...

    Best regards,
    perl -e "s>>*F>e=>y)\*martinF)stronat)=>print,print v8.8.8.32.11.32"