http://www.perlmonks.org?node_id=58562


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

I think that Devel::Peek's mstats function will do it for you. The documentation on CPAN doesn't give much help, but there's a place to start.