Perl Memory::Stats – Get RSS memory reporting on multiple platforms

It is often nice to be able to dump the current memory usage of a part of your process.

I’m working on Mac OSX, and I’m frustrating when a perl module only works on Linux, because it read file like ‘/proc’ or stuff like that.

Thanks to IRC users, I have discover Proc::ProcessTable, and then I have decide to create a module that use it to record the memory usage. The good point is that module work on Linux and Mac OSX, also on FreeBSD. I’m not sure on Windows.

My module is Memory::Stats, so how it works ?

You can also add checkpoints:

Enjoy !


Interesting read : Slide Asia YAPC for Memory Use

Short URL:

One Pingback/Trackback

  • timbunce

    Are you *really* sure you want the RESIDENT Set Size? The examples you gave suggest it’s not what you want. For example, on a busy system RSS can go down while total process size is growing. RSS is only really useful for forking servers on systems using copy-on-write. You probably want ‘size’ instead of ‘rss’. See also

    • Thanks a lot. I have add a link in the article to your slide. I will read it carefully when I’ve got time to breath

  • Pingback: Perl Memory::Stats | Weborama Dev Blog()