"be consistent" | |
PerlMonks |
Re^2: Multithreading leading to Out of Memory errorby joemaniaci (Sexton) |
on Jun 14, 2013 at 20:28 UTC ( [id://1039032]=note: print w/replies, xml ) | Need Help?? |
So after a few days of intermittent network connectivity(data is on a networked drive) and testing I figured it out. I think. push(@array, $data);I went down the path of using only 1 thread for processing. I went down the path of parsing only a single file type. Once I started the behavior went away, and of course it wasn't until the final file type that the behavior came back. I looked through my code to see what it had that no other file type had and it was... @array = sort { $a <=> $b } @array;So I took out that code and tested again, the problem was still present. So I kind of commented things out piece-meal until I narrowed it down to the single line of code above. With that single line of code 3 additional MB of memory is used up as the thread leaves the parsing method for that particular file type. So here is the basic rundown of this file.
, So after a few days of intermittent network connectivity(data is on a networked drive) and testing I figured it out. I think. push(@array, $data);I went down the path of using only 1 thread for processing. I went down the path of parsing only a single file type. Once I started the behavior went away, and of course it wasn't until the final file type that the behavior came back. I looked through my code to see what it had that no other file type had and it was... @array = sort { $a <=> $b } @array;So I took out that code and tested again, the problem was still present. So I kind of commented things out piece-meal until I narrowed it down to the single line of code above. With that single line of code 3 additional MB of memory is used up as the thread leaves the parsing method for that particular file type. So here is the basic rundown of this file.
I even tried clearing out that array after I was done using it, such as...
But this has no effect!?!? So what is going on?
In Section
Seekers of Perl Wisdom
|
|