Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^2: Delete parse data spreadsheet::parseexcel

by runrig (Abbot)
on Feb 06, 2013 at 00:19 UTC ( #1017308=note: print w/ replies, xml ) Need Help??


in reply to Re: Delete parse data spreadsheet::parseexcel
in thread Delete parse data spreadsheet::parseexcel

simply stop keep a reference to the parser object. Then the memory allocated for that object is freed.

No, not for Spreadsheet::ParseExcel objects...they contain circular references (workbooks reference worksheets and vice versa, etc.), so they don't go away until the end of your program. Best thing to do is to parse each spreadsheet in a separate process (using Parallel::ForkManager or just plain fork or just launch a separate system command or something).


Comment on Re^2: Delete parse data spreadsheet::parseexcel
Re^3: Delete parse data spreadsheet::parseexcel
by moritz (Cardinal) on Feb 06, 2013 at 00:53 UTC
    they contain circular references (workbooks reference worksheets and vice versa, etc.), so they don't go away until the end of your program

    If that's really the case, please open a bug report.

    However the source does use Scalar::Util::weaken, and my very basic testing shows that the objects do get released when I set the reference to the workbook to undef.

      Looks like you're right. This has been fixed since around 2007 in v0.30.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1017308]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (11)
As of 2014-10-22 09:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (114 votes), past polls