Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: memory consumption skyhigh...

by PetaMem (Priest)
on Mar 31, 2008 at 05:49 UTC ( [id://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

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 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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://677451]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (3)
As of 2024-03-29 06:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found