Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

Is there a way to set a limit on the RAM usage (virtual and resident) that a daemon can be granted in Debian? I understand that ulimit doesn't apply here, but something the right settings in /etc/security/limits.conf may be the answer.

I'm preferably looking for a concrete example. Say (whether this is actually a bad idea or not), limit virtual to 30MB and resident to 10MB for BIND. This setting should be enforced on the RAM used by all processes spawened by that daemon.


share|improve this question
up vote 2 down vote accepted

You can limit the maximum memory used by a program, but if the program want more memory, most of them just abort/crash/whatever.

So you have to configure bind to limit its memory usage.
The main option is max-cache-size (look at bind's configuration file, generaly into /etc/bind/named.conf). For example max-cache-size 10M
Don't use datasize if you don't really know what you do.

share|improve this answer

You wouldn't want to. Virtual memory isn't a scarce resource, so limiting it makes no sense. And limiting a program's resident memory just slows the whole system to a crawl because it makes it need more I/O.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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