I've run in to problems with Image::Magick before (Image::Magick Exception 430).

It doesn't release file handles used to read/write image files. I had a script running against directories of (coincidentally) highschool photos that turned them into various sized thumbnails. Despite every thing I could think of to 'close' Image::Magick between images, after about 2048 or so (what ever the internal system limit for open file handles) image manipulations, the script died with too many open files.

If your script is being run persistently, and it's using Image::Magick to read and save images, I can see how it might run out of file handles over time. I suspect the persistent process resets when it dies on the error, and then you get your random wait all over again for it to happen next.

If you give more information on how you're using Image::Magick, it could discounted (or focused on) as your problem. It may be as simple (or as difficult) as an Image::Magick update.

In reply to Re: How to debug "Too Many Open Files" Error by ruzam
in thread How to debug "Too Many Open Files" Error by tonyb48

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.