Scott R. Godin
Jul 7 2005, 03:34 PM
what are the various ways of finding out how much memory a particular
module is using, from the command line under Linux ?
Chris Devers
Jul 7 2005, 11:47 AM
On Thu, 7 Jul 2005, Scott R. Godin wrote:
QUOTE |
what are the various ways of finding out how much memory a particular module is using, from the command line under Linux ?
|
A lot the modules in the B:: and Devel:: namespaces can get at this sort
of information.
The Devel::Size module can get at this, at least partly.
<http://search.cpan.org/~dsugal/Devel-Size/Size.pm>
B::TerseSize also looks useful:
<http://search.cpan.org/dist/B-Size/lib/B/TerseSize.pm>
So you should be able to do something like this:
$ perl -MO=TerseSize -MCGI -e '$q = new CGI; 1;'
That suggests 240 bytes on my system, which is smaller than I expected,
but then I wasn't doing anything interesting. It may be more interesting
for use in profiling real programs.
--
Chris Devers