I think I have a program that creates countless forks of itself (not intentionally, I hope).

I like to test this but I can't kill the machine, so how could I limit the number of process to execute this in a sage way?

  • 5
    Did you forget to finish your title? – terdon Mar 7 '14 at 17:49

ulimit is used to temporarily establish limits to the current shell and its sons.

You can limit the number of process with ulimit -u $desired_number

More info in man ulimit and ulimit -a


limit.conf file

e.g. User1 to 20

user1 hard nproc 20

e.g. group1 to 50

@group1 hard nproc 50

Read more: http://linuxpoison.blogspot.co.uk/2009/01/how-to-set-limits-on-users.html#ixzz2vJifNgrT

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.