Reset running process when certain ammount of memory is consumed
6
votes
1
answer
1257
views
I'm running a Hydra on Rasppberry PI. There were some problems with the program, but aside from these, there is a hidden memory leak in the program. The source is pretty big and really can't find the problem.
Unfortunatelly, upon reaching memory limit, the program doesn't crash - instead it returns bunch of error messages. When I say bunch, I mean hundreds.
So I thought the if I can't un-allocate the memory within the program, I might need to reset whole process. **So I need to:**
1. Guard the process resource usage
2. Stop the process **gracefully** (similar to Ctrl+C, the program says "*received signal 2*" then)
3. Start the process again
I must do this until fix the program to die on errors - or not to produce them in the first place.
----
If you know hydra and you're curious about the errors I've found at least something in the code:

[ERROR] Fork for children failed: Cannot allocate memory [ERROR] socketpair creation failed: Too many open filesThe second part of the errors comes from
perror
C system function. It's sort of last error.
Asked by Tomáลก Zato
(1806 rep)
Jan 15, 2014, 11:36 PM
Last activity: Jan 16, 2014, 04:48 AM
Last activity: Jan 16, 2014, 04:48 AM