in reply to Re^2: memory blowing up when returning from a subroutine
in thread memory blowing up when returning from a subroutine
Returning a one should mean it wasn't the problem I suspected, BTW. Leaving that in place instead of using a bare return should be fine. The usual reason for such a memory jump is copying some sort of large data structure, so you might want to look for other reasons that might happen.
Another possible scenario just popped into my head, but it's pure speculation. Are you perchance calling the subroutine inside a while ( <filehandle> ) { .. } loop? If you are and it's a large binary file, it might be hundreds of megabytes before a newline appears. Again, a reproduction of the problem in a short snippet that doesn't give up any private data would be nice.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: memory blowing up when returning from a subroutine
by chuckd (Scribe) on Feb 05, 2009 at 20:15 UTC |