On Sep 24, 3:11*pm, Jerry Krinock <jerrykrin...@gmail.com> wrote:
> I've written a 1500-line script which processes several dozen files of
> source text written in Markdown to html. *It takes several minutes to
> run, indicating progress by printf statements. *However, about 20% of
> the time, in the middle of processing a Markdown file, it just stops
> progressing, as though it is in an infinite loop. *If I kill the
> process and restart, it always completes successfully.
>
> My script is, of course, being a script, not particularly efficient.
> I was thinking that maybe Perl was running out of memory or something,
> although that's not supposed to happen nowadays (Perl 5.10.0, Mac OS X
> 10.6). *And when I check it in Apple's Activity Monitor during normal
> operation, I find that its CPU and memory usage are hardly noticeable,
> maybe 3% and a few tens of megabytes.
>
> Are there any conditions under which Perl would "just stop"?
>
> Any suggestions to troubleshoot this would be appreciated.
>
You might try just setting a timeout around
whatever code section turns up in a stack
trace. (perldoc -f alarm).
Then exec the program again (perldoc -f exec)
if there's a timeout.. Of course if memory's
the problem, you may be able to find some way
to reduce memory usage and eliminate the timeout
workaround.
--
Charles DeRykus
|