I need to increase the default stack size on Linux. As I know there are usually two ways:

  • ulimit -s size
  • /etc/security/limits.conf

The ulimit method only works as long as I am logged in.

limits.conf will work after a restart.

Is there a possible way to increase the limit without restarting?

link|improve this question
feedback

migrated from stackoverflow.com Jul 21 '11 at 1:47

This question came from our site for professional and enthusiast programmers.

2 Answers

What's wrong with editing your .bashrc file to do a ulimit -s size every time you start a terminal session?

link|improve this answer
unfortunately that is not for me as a user, it is for the couchdb process, which crashes because a document in the DB is to big to fit in the stack. – Simon Jul 21 '11 at 11:17
@Simon: that means you're currently restarting that process every time? How is that done? Can't you splice the ulimit -s size in the scripts that control the restarts? – MSalters Jul 21 '11 at 12:48
well, it is a subprocess of couchdb that crashes (couchjs). So all processes started by the user couchdb should have a bigger stack – Simon Jul 21 '11 at 13:07
feedback

If you want to do this programatically, you can use the setrlimit() function.

link|improve this answer
unfortunately I need to set the limit for couchdb, not for a program of my own. So setting it programatically is out of question – Simon Jul 21 '11 at 11:17
feedback

Your Answer

 
or
required, but never shown

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