OliverSamson has asked for the wisdom of the Perl Monks concerning the following question:

This node falls below the community's minimum standard of quality and will not be displayed.
  • Comment on Occupancy of Perl functions, variables etc

Replies are listed 'Best First'.
Re: Occupancy of Perl functions, variables etc
by tachyon (Chancellor) on Jul 26, 2004 at 14:02 UTC

    Well based on your less than enligtening description:

    1. If you are on Win32 get used to it, this is SOP. Attend to your 3 finger salute.
    2. If you are on *nix I suggest not slurping the entire contents of your file system into a scalar. This leads to memory exhaustion and data is then swapped to disk. This is bad, as it means you have yet more info to read
    3. fork while 1 is bad

    Seriously how on earth do you expect anyone to offer any sort or sensible suggestion based on your 'invisible code that does script like stuff does not work under stress crashing computers (plural?) on unspecified operating system using some version of some scripting language, presumably perl' description?

    I would suggest Tutorials and some of the how to ask a question links as the first stop. Then I would suggest posting a snippet of code that recreates you does not work issue here.

    High on the list is using all your memory and hitting swap.

    cheers

    tachyon

Re: Occupancy of Perl functions, variables etc
by gaal (Parson) on Jul 26, 2004 at 13:59 UTC
    If the script mostly consumes memory and CPU, it oughtn't crash a properly tuned operating system. If you're on Unix, check out limits (ulimit with bash, limit with (t)csh, etc.) and avoid running the script as root.

    After you've got that set up, you can safely run the script on smaller datasets and try to see why it goes wild. Does it not reuse resources? Must it keep track of everything at the same time, or can the job be split up to smaller tasks? It's hard to give more specific advice without more specific knowledge of your problem, but these are the kind of questions to ask.

Re: Occupancy of Perl functions, variables etc
by pbeckingham (Parson) on Jul 26, 2004 at 13:56 UTC

    If the script is small, post it. If long, reduce it to a smaller script that misbehaves. Then post it. It's unlikely that you'll get meaningful help as we speculate and what your script might be doing.