News for hackers. Stuff that matters.
Re:Linux memory overcommit (compared to airlines selling tic... by willvarfar on Friday May 13, 2011 @08:39AM (#2544392)
I've always felt this should be settable per heap.

I would happily set it in my programs explicitly.

Re:Linux memory overcommit (compared to airlines selling tic... by zorked on Friday May 13, 2011 @10:16AM (#2544687)
You can disable overcommit globally (/proc/sys/vm/overcommit_memory).

At the application level, you can allocate as much memory as you want and then write to it all. You are not guaranteed not to die of OOM while doing this, but at least you will know right away that you will have enough memory in the long run.

The point of overcomitting is that it reduces the possibility of OOM errors. I think people are just offended that the kernel is killing their process. With overcommits turned off, the OOM would have happened sooner, and I doubt most applications would have handled it any better than the kernel did. If you think the kernel is wrong, or if you don't like this behavior, you can both customize the OOM killer and turn off overcommitting.

Also, overcommits are by no means specific to Linux. FreeBSD, OS X, HP/UX and so on all have it. I _think_ Solaris is the exception here. But if you want the Solaris behavior, you can have it under Linux too.

Re:Linux memory overcommit (compared to airlines selling tic... by JoachimSchipper on Friday May 13, 2011 @08:51AM (#2544413)
You can, at least, limit memory by using setrlimit() (resource limits) or your shell's ulimit command.

I'm not sure that disabling overcommit on a per-process basis makes sense.