in reply to Re: out of memory problem after undef
in thread out of memory problem after undef
Because the second structure uses more memory (to build if not when complete) than the first.
Not so!
The AoH with 50 hashes each with 250_000 key/value pairs requires close to 1 GB, when finished and over 1.5GB to construct. Whereas the array of 10e6 integers requires just 220MB, and a peak of 330MB to construct.
The problem is that none of the memory freed up by releasing the AoH is large enough to be reused for the AV for the array, because Perl doesn't defragment or coalese freed memory. So, even though Perl has gobs of free space available to it, it has to go back to the OS for more in order to get big enough chunks for the array.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: out of memory problem after undef
by ikegami (Patriarch) on Dec 03, 2008 at 22:12 UTC | |
by BrowserUk (Patriarch) on Dec 03, 2008 at 23:55 UTC |