<?xml version="1.0" encoding="windows-1252"?>
<node id="997794" title="Re: Out of memory and While replacements with excel XLSX application" created="2012-10-08 06:02:32" updated="2012-10-08 06:02:32">
<type id="11">
note</type>
<author id="45414">
jmcnamara</author>
<data>
<field name="doctext">
&lt;p&gt;The "out of memory" issue is probably caused by Excel::Writer::XLSX. Especially if you have 1 million rows.
&lt;/p&gt;
&lt;p&gt;
You can reduce its memory usage (almost completely*) by setting the workbook  &lt;tt&gt;set_optimization()&lt;/tt&gt; method.

&lt;/p&gt;

&lt;code&gt;
    ...
    my $workbook = Excel::Writer::XLSX-&gt;new( file.xlsx' );
    $workbook-&gt;set_optimization();

    my $worksheet = $workbook-&gt;add_worksheet();
    ...
&lt;/code&gt;

&lt;p&gt;
* See the [http://search.cpan.org/~jmcnamara/Excel-Writer-XLSX/lib/Excel/Writer/XLSX.pm#SPEED_AND_MEMORY_USAGE|Speed and Memory Usage] section of the Excel::Writer::XLSX docs for a full explanation.
&lt;/p&gt;
&lt;p&gt;
--
&lt;br&gt;
John.
&lt;br&gt;
</field>
<field name="root_node">
997733</field>
<field name="parent_node">
997733</field>
</data>
</node>
