Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: memory consumption skyhigh...

by PetaMem (Priest)
on Mar 31, 2008 at 05:49 UTC ( #677451=note: print w/ replies, xml ) Need Help??


in reply to memory consumption skyhigh...

In general: Your problem might not be the keys, but the values of your hash.
#!/usr/bin/perl use warnings; use strict; use Devel::Size qw(size); my %hash = (); for my $key (1..27000) { $hash{"blahblahblahblah$key"} = 1; } print size(\%hash);
The keys are really not small here and they also contain a hell of redundant data. But size for the hash speaks of 1736142 bytes. It also has 27.000 entries like yours. I think your optimizing on the wrong part of your data structure.

Bye
 PetaMem
    All Perl:   MT, NLP, NLU


Comment on Re: memory consumption skyhigh...
Download Code
Re^2: memory consumption skyhigh...
by spx2 (Chaplain) on Mar 31, 2008 at 10:09 UTC
    Example of what am I trying to do and also of the data I'm handling In generate.pl freq_tuple3 is the 3-key hash I was talking about.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (9)
As of 2014-12-20 04:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (95 votes), past polls