On Wed, Oct 13, 2010 at 8:42 AM, Panda-X <[email protected]> wrote:
> Hi List, > > My script is running on WinXP, Dos shell, which is a server program. > > It works fine, unless it will pops-up a "Out of Memory!" and stop running > per each few days! > > Could someone tell me this error message is coming from Perl ? or from the > Dos shell ? > > Thanks! > ex > Good question, most likely a program on your system is eating memory and not letting go. Over time you will run out of memory and you will get this message. The problem might be your script or well, anything else on your system that is running at the same time. Even though I do not doubt your programming skills I would suggest a simple test. Don't run your script for a few days and see if you get the same error. If so you are sure that it is not caused by your script, if you don't get the error then your script is the problem and you have some fun debugging to do. Normally perl is quite good in the cleaning up of unused resources memory or otherwise, but as a developer you can make it very hard for perl to keep the memory clean. You might be building an array, a hash or some other data element that never stops growing, or that you copy data from A to B to C and never really release any of them etc. Specially scripts that are supposed to run constantly will need you as a developer to pay special attention to keeping the memory foot print within reason... It might be a good idea to post the script to this list and ask people to help you out, often a mistake like this is not hard to spot and usually takes a few minor changes to help perl keep the memory footprint nice and small. I'm sure that there are debug options in perl that can help you with this as well I have never ended up using them as the few scripts that I did write that had to live forever didn't cause me any memory problems (a few other non-memory related once though) so I have no idea how to debug stuff like that with perl. Regards, Rob
