in reply to freeing hashes on Linux

We had the same problem - traced to a buggy version of GCC - our production version is buggy gcc 2.95.4

The solution was to

1) Use a GLOBAL scope for the offending large hash - I know it runs against the grain, but you DONT want it to go out of scope or your process will sit around for ages running buggy malloc() reshuffles.

2) Use POSIX::_exit($exitval); instead of exit() - this exits immediately without bothering to do the last garbage collection

For us, with hashes of 200MB - 1.2GB this reduces task times from 35 minutes to 5 minutes!

Regards

Jeff

Replies are listed 'Best First'.
Re: freeing hashes on Linux
by Abigail-II (Bishop) on May 22, 2003 at 20:39 UTC
    Well, Perl does have it's own malloc, which you can turn on if you compile Perl with the -Dusemymalloc.

    Abigail

      We tried Perls malloc - even worse problems than the GCC 2.95 malloc, which runs slow, but at least runs reliably to completion.

      We also tried upgrading GCC but then our MySQL connections would fail after several 10s of MB interaction with the MySQL server.

      regards,

      Jeff