I've had a similar problem, I was only reading a 2 meg file, and was using over 200 megs of ram; but I was doing much more with it.

First, let me say, using hashes takes some extra space over arrays, and you should be aware of that going in.

Second, the more modifications to data, the more Perl "e;Meta"e; data is required. From what I understand, and please correct me if I'm wrong, this meta data speeds up incremental modifications on your hashes and arrays.

In short, it is not out of bounds to get a lot of memory usage with perl, with big, or small datasets, depending on how much you are doing with them.

Perhaps there is a better way of splitting up the problem (maybe writing the data out to two or more files as you read based on the employee so that you have smaller datasets to work on.)

--
Kwyjibo. A big, dumb, balding North American ape. With no chin.

In reply to Re: Out of memory Error by abitkin
in thread Out of memory Error by treebeard

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.