You haven't mentioned which version of perl you're using. I've noticed memory problems that went away when upgrading from 5.6.x to 5.8.x. Specifically, I was using XML::Twig, which, of course, uses XML::Parser, which I'm sure at least some of your modules use. I suppose the overhead in all the XML handling that I was doing managed to confuse 5.6, but those problems were fixed in 5.8.

So, that's my first offering. My experience managed to crash in inconsistant locations, but, abstractly it was consistant: every time I ran my program. My program was taking an existing ~50KB XML file, and then add data it got from another source to make a multi-hundred KB XML file (actually, I have a hard time remembering, but I'm guessing it was multi-MB at the end). This may be your problem in that, over multiple requests, you're chewing up too much memory - and some of it may be memory junked inside the expat XML parsing C library.

Thus, one solution is to upgrade perl, if you haven't already gone to perl 5.8.3+. Another is to reduce the number of requests each Apache child can handle before exiting, thus exiting before the accumulation of problem memory chunks to the point of a crash. This latter idea is not dissimilar to the idea of rebooting NT4 servers nightly to keep them from crashing after about 40 hours of uptime, which I seem to recall was a popular problem. It's not the right solution (the server should be fixed - in this case, it's probably between Perl and Expat), but it offers a useful workaround until then.


In reply to Re: mod_perl go boom, mod_cgi works by Tanktalus
in thread mod_perl go boom, mod_cgi works by hacker

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.