in reply to Re: Re: Re: RegEx on 4MB file consumes of 2GB of ram before windows shuts it down.
in thread RegEx on 4MB file consumes of 2GB of ram before windows shuts it down (Memory Leak in 5.8.2)

Ick. What version of perl are you using? On a hunch, some quick googling revealed that some regex memory leaks with the s/// operator were introduced in 5.8.1. Seems like they should be fixed in 5.8.3.

If you can't upgrade, then your best bet may be to try to read the file section by section rather than having the whole file in memory each time through. Best of luck!

-xdg

Code posted by xdg on PerlMonks is public domain. It has no warranties, express or implied. Posted code may not have been tested. Use at your own risk.

  • Comment on Re: Re: Re: Re: RegEx on 4MB file consumes of 2GB of ram before windows shuts it down.
  • Download Code

Replies are listed 'Best First'.
Re: Re: Re: Re: Re: RegEx on 4MB file consumes of 2GB of ram before windows shuts it down.
by Ardemus (Beadle) on Apr 12, 2004 at 17:28 UTC
    perl -v shows version 5.8.2 - Thanks, that's probably it. Nick