i have a binary, which indexes some stuff, it eats all my ram and my swap. Then the server hangs.

I would like to limit its ram usage.

I've looking at cpulimit and /etc/security/limits.conf but both of them focus on cpu limits and user/processes .

Have somebody limited the usage of a certain binary? How can I approach this issue?

Thanks

link|improve this question

72% accept rate
1  
You do this per-user with ulimit. – Anonymous Mar 26 '10 at 15:18
feedback

2 Answers

up vote 4 down vote accepted

Use ulimit. In particular ulimit -m.

link|improve this answer
feedback

limits.conf has several entries to limit memory usage you may consider, i.e. data, rss, stack.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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