Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Answer: How do I find the memory used by a particular hash (NOT including perl itself)?

by QwertyD (Pilgrim)
on Apr 12, 2004 at 21:36 UTC ( #344539=categorized answer: print w/replies, xml ) Need Help??

Q&A > programs and processes > How do I find the memory used by a particular hash (NOT including perl itself)? - Answer contributed by QwertyD

Use the Devel::Size module.

For example, to determine the amount of memory in bytes used by a hash named %hash:

use Devel::Size qw(total_size); my $memory_used = total_size(\%hash);

If the hash contains any references to other variables, the memory those variables use will be added as well.

  • Comment on Answer: How do I find the memory used by a particular hash (NOT including perl itself)?
  • Download Code
Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
[Discipulus]: the new spam: gdpr consensus mail
[Corion]: Yeah, but the hope is that when I just delete it I won't receive any more mail from them
[Corion]: ... a faint hope, I know
[Discipulus]: ah ah you are still so optimist, Corion ? ;=)

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (5)
As of 2018-05-25 07:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?