Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Out of memory and While replacements with excel XLSX application

by jmcnamara (Monsignor)
on Oct 08, 2012 at 10:02 UTC ( #997794=note: print w/replies, xml ) Need Help??


in reply to Out of memory and While replacements with excel XLSX application

The "out of memory" issue is probably caused by Excel::Writer::XLSX. Especially if you have 1 million rows.

You can reduce its memory usage (almost completely*) by setting the workbook set_optimization() method.

... my $workbook = Excel::Writer::XLSX->new( file.xlsx' ); $workbook->set_optimization(); my $worksheet = $workbook->add_worksheet(); ...

* See the Speed and Memory Usage section of the Excel::Writer::XLSX docs for a full explanation.

--
John.

  • Comment on Re: Out of memory and While replacements with excel XLSX application
  • Download Code

Replies are listed 'Best First'.
Re^2: Out of memory and While replacements with excel XLSX application
by Weinstar (Initiate) on Oct 09, 2012 at 05:09 UTC

    This answer was the first one I succefully implemeted. It was a solution to the original question of how to avoid a "out of memory" return, while still writing to .XLSX files. Thanks to the poster.

    The total system memory use never exceeded 4GB as before and the total runtime seemed unchanged.

    I will test some the other solutions to see if the runtime can be optimized through better coding on my part.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://997794]
help
Chatterbox?
[LanX]: ;p
[marto]: LanX I'd rather commit sudoku :P
[marto]: trench humour folks, feeling rough.
[marto]: there is never a night when they sleep all the way through, but last night was something else
[marto]: gave in at 3:45 ish and let Charlie watch videos about spitfires, the battle of Britain. He's plane crazy
[1nickt]: marto soothing!
[marto]: Hiromi makes an appearance, let's hope Jools doesn't ruin it by joining in on the old Joanna
[1nickt]: karlgoethebier What is the issue with the semic-colon after the ellipsis? It's documented as proper syntax ...;

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (7)
As of 2017-11-18 18:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:













    Results (277 votes). Check out past polls.

    Notices?