Memory Usage

Ovid on 2004-03-28T19:21:05

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).

Update: Eh, what the heck. This is a test box, so I'm upgrading to 5.9.1 and adding -DPERL_DEBUGGING_MSTATS anyway. Of course, reading the source reveals that the problem appears to be fixed, but we'll see.


XML::LibXML...

Matts on 2004-03-29T08:17:07

Has a memory test that you can enable with an environment variable. It uses /proc/self/statm for the data. It's unportable but it works.