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

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 the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (7)
As of 2016-10-27 01:27 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (351 votes). Check out past polls.