Help - Search - Member List - Calendar
Full Version: Module memory usage
WorkTheWeb Forums > Webmaster Resources > Perl Beginner Help
Support our Sponsors!
Scott R. Godin
what are the various ways of finding out how much memory a particular
module is using, from the command line under Linux ?

Chris Devers
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


PHP Help | Linux Help | Web Hosting | Reseller Hosting | SSL Hosting
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2005 Invision Power Services, Inc.