in reply to memory usage Spreadsheet::ParseExcel
Do the Monks have any idea how to free the memory used ...
If, as appears to be the case from the follow-on discussion, the problem is circular references preventing the data structures being destroyed, maybe running a depth-first function to free it might resolve the problem.
See how you get on with this:
sub recursiveFree { my $ref = shift; if( ref $ref eq 'ARRAY' ) { recursiveFree( $ref->[ $_ ] ) for 0 .. $#{ $ref }; } elsif( ref $ref eq 'HASH' ) { recursiveFree( $ref->{ $_ } ) for keys %{ $ref }; } elsif( ref $ref and ref $ref ne 'SCALAR' ) { warn "Unhandled reftype: ", ref( $ref ); } undef $ref; return; } recursiveFree( $xls );
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: memory usage Spreadsheet::ParseExcel
by Anonymous Monk on May 14, 2012 at 13:59 UTC | |
by BrowserUk (Patriarch) on May 14, 2012 at 15:00 UTC | |
by Anonymous Monk on May 15, 2012 at 00:23 UTC | |
by BrowserUk (Patriarch) on May 15, 2012 at 00:47 UTC |