Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: A different kind of Spreadsheet::ParseExcel memory problem.

by philcrow (Priest)
on Sep 09, 2005 at 17:51 UTC ( #490678=note: print w/replies, xml ) Need Help??


in reply to A different kind of Spreadsheet::ParseExcel memory problem.

A quick look with Data::Dumper shows me that Spreadsheet::ParseExcel has circular links in its structures. Namely, the S::P::Cell objects have a Format key which refers the parent object. Thus, if those links are not weakened, the structure will not be released properly when the objects go out of scope.

To fix this would probably require a patch involving the use of weaken in functions that make S::P::Cell objects, or DESTROY methods which do that when the object is about to be garbage collected.

If a patch is not an option for you, you could carefully fork a new process for each file or break up the task in some other way.

Phil

  • Comment on Re: A different kind of Spreadsheet::ParseExcel memory problem.

Replies are listed 'Best First'.
Re^2: A different kind of Spreadsheet::ParseExcel memory problem.
by jcoxen (Deacon) on Sep 10, 2005 at 03:22 UTC
    I'm sorry I took so long to respond to your suggestion but it takes a while for my script to run and I wanted to let it finish before I replied. I was very intrigued by your idea. I was planning on implementing forking but not until after I had everything else working. Regardless, I went ahead and put it in. And it worked! 846 files and no 'Out of Memory' errors.

    Thank you very much for the help

    Jack

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (4)
As of 2021-07-30 14:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?