Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question

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

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

    
There must be a way to do this. The ulimit shell command doesn't work for a user. And the current logged in user doesn't have permission to alter their limit unless they are root. – Matt H Dec 21 '12 at 1:45

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

share|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

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

share|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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .