![]() |
|
We don't bite newbies here... much | |
PerlMonks |
Re: Catching Cheaters and Saving Memoryby Anonymous Monk |
on Oct 12, 2006 at 15:27 UTC ( [id://577875]=note: print w/replies, xml ) | Need Help?? |
So, last time it was enough to not slurp the data, but now I'm worried that the hashes are going to blow up (have any of you had a million by million 2-D hash?).
And rightly so. The overhead of an empty, anon hash is 92 bytes on my system (this may vary by a few bytes depending on your build). If you have a million of them, that's 92 Mb just for the hashes. You've nothing stored in them yet. A string takes 25 bytes, not counting the content of the string. Keys take slightly less, but they are still overhead. And each byte overhead multiplied by a million is an Mb. If you have 55 Gb of raw data, which you are storing as short strings, you'll be looking into hundreds of Gbs of memory usage. You might want to use a real database instead.
In Section
Seekers of Perl Wisdom
|
|