Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Data structure Memory Usage

by arunhorne (Pilgrim)
on May 21, 2003 at 09:55 UTC ( #259678=perlquestion: print w/ replies, xml ) Need Help??
arunhorne has asked for the wisdom of the Perl Monks concerning the following question:

Monks,

How can I find out how much memory my datastructure is using up, e.g. if I have:

my %struct = ("key1" => ["bill","ben"], "key2" => ["dave","jen"]);

Is the some function I can pass a reference, \%struct to to find out the memory usage?

Thanks,

____________
Arun

Comment on Data structure Memory Usage
Select or Download Code
Re: Data structure Memory Usage
by broquaint (Abbot) on May 21, 2003 at 09:58 UTC
    How can I find out how much memory my datastructure is using up
    Use Elian's marvellous Devel::Size e.g
    use Devel::Size 'total_size'; my %struct = ("key1" => ["bill","ben"], "key2" => ["dave","jen"]); print "total size of %struct - ", total_size(\%struct); __output__ total size of %struct - 412
    See. Devel::Size for more info.
    HTH

    _________
    broquaint

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (12)
As of 2014-08-21 19:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (143 votes), past polls