Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Data structure Memory Usage

by arunhorne (Pilgrim)
on May 21, 2003 at 09:55 UTC ( [id://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

Replies are listed 'Best First'.
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
Domain Nodelet?
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?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (4)
As of 2024-03-19 10:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found