Hi Monks

I am looking for ideas to contain and manage a Segmentation Fault that arises after several iterations of a batch process which, admittedly, is huge in both Perl code and data and data structures (that may not be getting cleaned up properly when finished with). The system monitor shows 100% cpu usage and 98% memory usage after the crash.

The process suite, normally invoked for just single iterations, has given no problems before. But in a batch loop after 5 to 12 or so it runs out of puff with a Segmentation Fault. Eval does not trap the crash.

The code is far too big and complex to go into, using many many external modules (some big), such as BerkeleyDB, Spreadsheet::WriteExcel etc., and literally tons of hashes and arrays etc., and maybe 20 or so internal modules in the worst cases.

If I could somehow predict the overload (my best guess from the circumstances) in advance, I could break up the batch runs into non-arbitrary smaller chunks, or if there were a module to clean up after calling certain modules before they are re-invoked, I could make use of that perhaps? Unfortunately there is no message besides the raw "Segmentation Fault".

o.k. you probably get the idea. This is Perl 5.8.7 compiled over RedHat 8 with linux kernel 2.4.20.

Any helpful thoughts appreciated.

cheers

Pstack


In reply to segmentation fault by Pstack

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.