... it means that something killed it. I'm assuming a unixy platform here, which means there's no way to catch the SIGKILL, but you may find something in the /var/log files. That is, unless you generate an error somewhere like that in the program.
| [reply] |
It's probably something in the OS doing it, not within your script. If you're running Linux with a 2.4 or higher kernel, it will often be configured to kill off processes automatically if they reach a certain level of CPU or memory usage. Another possibility is ulimit (altho I'm not sure if that kills processes or just limits them). | [reply] |
I found it!!
Something in the OS - that was also my first thought, as I did not write such a silly error msg into my script.
I am running Debian/Linux (Ubuntu). And the hint to var log was right: I found in var/log/kern.log an entry which sais "Out of memory: Killed process 2832 (perl)", which is what triggered the event!
What my server-script does: it consumes (and needs) quite an amount of memory (about 200MB of 1Gig system dram total). The log also tells some swapping happened before the event, I think that swap, plus system plus my script was just too much... Now, I will insert some tweaks to reduce ram usage, until the system receives more physical ram. Thanks again!
(although I am not yet such an ace to know what oom and ulimit exactly is..;) )
| [reply] |
One thing you might want to try is restarting your server periodically (if that's practical). perl has a habit of accumulating memory over long periods of time. Restarting the process should reset all that.
| [reply] |
| [reply] |
In linux, the OOM killer kills. I suspect the ulimit memory killer does too... It probably changes from *nix to *nix though. I wonder if the oom killer is the ulimit killer. Huh.
| [reply] |
Is there a way to measure the size of my data structures while the script is running?
If so, I could test my structures for size every few cycles and see if there is a memory leak I didn't thought of. | [reply] |
I typically watch this by running top and keeping an eye on the VIRT (total memory usage) and/or RES (physical/non-swap memory usage) columns.
| [reply] [d/l] [select] |