Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Module for memory allocation

by leslie (Pilgrim)
on Feb 27, 2009 at 04:33 UTC ( [id://746752]=perlquestion: print w/replies, xml ) Need Help??

leslie has asked for the wisdom of the Perl Monks concerning the following question:

Hi monks,

I want to know how much memory my perl script is taken.
Is there any module available for finding this ?

Replies are listed 'Best First'.
Re: Module for memory allocation
by irah (Pilgrim) on Feb 27, 2009 at 05:12 UTC

    Use Devel::Size module from CPAN.

    This module is used to find the memory usage of Perl variables. Read about the functions size and total_size from that module.

Re: Module for memory allocation
by irah (Pilgrim) on Feb 27, 2009 at 04:41 UTC
Re: Module for memory allocation
by lakshmananindia (Chaplain) on Feb 27, 2009 at 04:52 UTC

    An unix way is by using the top command

Re: Module for memory allocation
by sundialsvc4 (Abbot) on Feb 27, 2009 at 15:56 UTC

    It's important also to realize that Perl might ... at first blush ... appear to be “positively wasteful” in its memory-allocation. It uses an opportunistic memory manager that does not attempt to “minimize” the amount of memory that has been consumed. What it does seek to do is to provide good memory-allocation with an overhead pattern that is both consistent and predictable, even for programs that might run for months at a time without stopping.

    The rationale behind this memory-management strategy has of course been discussed thousands of times throughout the Internet.

Re: Module for memory allocation
by boom (Scribe) on Feb 27, 2009 at 04:40 UTC

    Use this command du -sh yourperlprogram.pl

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://746752]
Approved by ww
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (5)
As of 2024-04-19 07:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found