hi monks, I have created hashs of hashs for a very large data file just trying to use my 8GB RAM. But it has a out of memory problem. My code is fine for smaller size of data, but not the whole data (20000000 lines). the major chunk of code is as below:
while(<>){ if (/^#+/){NEXT;} else{ chomp; @data=split (/\s+/,$_); $a=$data[0]; $b=$data[3]; $c=$data[4]; $d=$data[5]; $row{$a}{$b}{$c}=$d; } } print "Fished establishing hashs.\n";
I don't think the problem resulted from limited memory since it reported "out of memory" when it only used 40% of my 8GM ram. Could any perl guru help me resolve this problem? Thanks.

In reply to out of memory problem by lightoverhead

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.