1. I think you need to change the extension of ur image file to either JPG for processing the file or

2. possibly since it is going out of memory then try using less expensive methods to read the file in the directory i.e. rather than reading the entire file into an array read it line by line. I am not sure how it works with image file but I am sure there will be some methods to do that.

3. empty the arrays or hash or the any data structure whichever you are using after using it rather than over witing it.

Good Luck !!

1. I understand what desemondo (Friar) is saying but, my intention was that we can reduce the time for doing the manipulations with the file by converting into JPG and see if it is working fine or not. 2. Empty the data structures means that in case you are doing the push or shift operations then it will take a lot of time as compared to using the same in smaller parts.


In reply to Re: Out of memory issue by snape
in thread Out of memory issue by ralphch

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.