Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical

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.

    All Perl:   MT, NLP, NLU

Replies are listed 'Best First'.
Re^2: memory consumption skyhigh...
by spx2 (Deacon) 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 freq_tuple3 is the 3-key hash I was talking about.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://677451]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (4)
As of 2018-05-25 20:55 GMT
Find Nodes?
    Voting Booth?