in reply to Memory Error Printing Multiple Hashes Simultaneously

You're allocating 3 hashes with 25,000,000 elements each and don't see where memory would be getting used?

/boggle

I just ran this (the three hash version) and the process size got up over 1.5G of memory used (OS X 10.4.4, stock perl); I don't think it's out of the question that that much usage would hit up against either a soft or hard process size limit on an arbitrary AIX box. Check with the output of ulimit -a and/or your sysadmin.

  • Comment on Re: Memory Error Printing Multiple Hashes Simultaneously

Replies are listed 'Best First'.
Re^2: Memory Error Printing Multiple Hashes Simultaneously
by bernanke01 (Beadle) on Jan 31, 2006 at 00:09 UTC

    Oh I realize that, but the thing is the hashes seem to get created okay, its just during printing that the machine hits a memory problem. And, deleting keys as I print them solves the issue: that's the puzzling part. Where in my nested-while loops would memory be getting used? The printing gets about half-way through before crashing, so at that stage I can't see why additional RAM would get used (it's 32-bit perl, so while the box has more maximum addressable would be 4Gb I guess).

    Update: Also, it occurred to me that there should only be (5001 * 5000 / 2) = ~12.5 million elements in each hash, so not quite so bad as having three hashes of 25 million!