<?xml version="1.0" encoding="windows-1252"?>
<node id="1015649" title="Re: memory issues" created="2013-01-28 04:13:20" updated="2013-01-28 04:13:20">
<type id="11">
note</type>
<author id="171588">
BrowserUk</author>
<data>
<field name="doctext">
&lt;blockquote&gt;&lt;i&gt;&lt;/i&gt;&lt;/blockquote&gt;
&lt;p&gt;The problem is that this line:&lt;code&gt;
        if($ipairs{$fk}{$pair}{'pvalue'}){
&lt;/code&gt;

&lt;p&gt;Rather that just testing if that value exists, it is autovivifying (creating) that value in the nested hashes and setting it to null. 

&lt;p&gt;If you change that line to:&lt;code&gt;
        if( exists $ipairs{$fk}
        &amp;&amp;  exists $ipairs{$fk}{$pair}
        &amp;&amp;  exists $ipairs{$fk}{$pair}{'pvalue'}
        ){
&lt;/code&gt;

&lt;p&gt;It should prevent the runaway memory growth. As a nice side-effect, your program should run substantially faster also.

&lt;p&gt;BTW. I assume you mean 32&lt;b&gt;G&lt;/b&gt;B not 32MB?

&lt;div class="pmsig"&gt;&lt;div class="pmsig-171588"&gt;
&lt;hr /&gt;
&lt;font size=1 &gt;
&lt;div&gt;With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'&lt;/div&gt;
&lt;div&gt;Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.&lt;/div&gt;
&lt;div&gt;"Science is about questioning the status quo. Questioning authority". &lt;/div&gt;
&lt;div&gt;In the absence of evidence, opinion is indistinguishable from prejudice.
&lt;/div&gt;
&lt;/font&gt;

&lt;/div&gt;&lt;/div&gt;</field>
<field name="root_node">
1015642</field>
<field name="parent_node">
1015642</field>
</data>
</node>
