1

We must launch several hungry processes on a Linux system. These processes often need several Go (~5Go) of memory to run (total memory: 16Go RAM + 2Go swap).

  • At first, when the system was running out of memory, the OOM-killer killed processes, we had to reboot the system each time it happened.

  • Then, we have tried to use the overcommit_memory (= 2) + overcommit_ratio (= 75) parameters, so processes are not launched when the situation is getting critical. So, no need to reboot the server anymore. But our launching script now report dozens of errors when the limit is reached : the new processes are immediately in error, the processes are never launched.

  • So now we are looking for a solution to launch "as many" processes as we want, and then they would be delayed/paused or anything, waiting for their brothers to stop... Does it exist ?

  • Memory is dirt cheap, increase it and increase swap too. – schaiba Nov 29 '13 at 17:14
0

You can find the amount of free memory from /proc/meminfo

You can suspend any process by sending it SIGTSTP (kill -SIGSTP pid).

You can then resume it with SIGCONT

Of course suspended process does not free any memory, just doesn't consume any more until resumed, and of course you need to know PIDs of processes to be suspended - probably by getting them to write them to disk somewhere. You didn't tell enough about your situation to determine if that suffices, but this should give you some direction.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.