in reply to Re^3: memory blowing up when returning from a subroutine
in thread memory blowing up when returning from a subroutine

YES! YES! I am!
I have something like this:
while (<$DATFILE>) {
%hashFile = ();
$hashFile{someKey} = someValue;
$hashFile{someKey} = someValue;
$hashFile{someKey} = someValue;
$hashFile{someKey} = someValue;
InsertData(\%hashFile);
$cnt++;
}
and some of these values are very large e.g. text from files.
This hash is very large at times.

But the frustrating part is that it doesn't blow it up until after like the 1 millionth increment from the while loop.
And it blows up as soon as I hit the $cnt++ incrament. So I can return from the subroutine ok and step to $cnt++, but as soon as I step past $cnt++ it blows up the memory.
I'm going to change the filehandle from a type glob to a regular filehandle. I don't think it will help but I'll see.
  • Comment on Re^4: memory blowing up when returning from a subroutine