Reliability isn't reached by low memory conditions and an OOM killer.
It is wrong to organize a party in a closet and place "cleaning out my closet" on your small playlist.
Is it possible to make the OOM killer intervent earlier?
Doing this will have unintended side results, because you have no control over what is killed.
I try to tweak my development system to maximal reliability.
Maximal reliability involves testing your system and improving your system based on these tests.
Just tweaking random things won't get you anywhere...
I disabled swap, because for GUI usage it mostly renders the machine unresponsive in such a way not useable anymore. Nevertheless, if agressive appications eat up the memory, some mechanisms seem to kick in that making the most out of it on cost of speed.
Due to low memory conditions, disabling the swap won't improve the behavior, it does the opposite.
To increase reliability in this situation, add more memory such that your system is more responsive and there are no random processes being killed without the user's intention. You shouldn't resort on low memory conditions and a mechanism like this, especially not in a development environment...
There is no harddrive swap operation, but the system is getting unresponsive likewise.
Low memory conditions indeed result in unresponiveness, whether you have a swap or not.
So I want to let the OOM killer kick in before the system make any special efforts on memory gain.
Special efforts that will do more harm than good, as I explained above. Instead, you could kill processes you don't need yourself, but I guess you can't do that so the OOM will kill processes that you need.
Is it possible to configure the OOM killer to act if there is less than 100 MB free physical memory for example?
Might be, but you get a higher return on investment if you just buy some extra memory which doesn't really cost much these days. Consider that you're going to hit yourself in the foot on the long run if you continue to work on low memory conditions. OOM is like a bailiff, it doesn't assist you, it assists the OS...
2I think the real issue here is, there's not enough ram to start with. You won't use swap unless there's no ram. By turning off swap... you run out of ram and have no where to page it to. Which causes ugly things to happen. Your system seems to be set up badly, and no amount of tweaking will fix that. – Journeyman Geek – 2012-03-29T08:51:05.350
9I don't agree. Development and 'power use' often involves experimental usage. For example, when using a command line image processing tool, there are no specs how much memory it's operation take in relation to the image size. So I just give it a run. And I don't expect it to render my whole machine useless. For a single experiment, I could use ulimit to keep it secured, but for whole system operation with sometimes plenty of operations, the containment of one process is not so usefull but a 'life insurance' for the whole machine definetly is. – dronus – 2012-03-29T11:14:21.573
Simply said, in my wide field of everyday usage, there are plenty of tasks my machine is able to handle, but some it is not able. – dronus – 2012-03-29T11:18:33.440
1The fact that your system grids to a halt when using swap is suspect. Your computer is using swap cause its out of memory. Swap is slowing down cause disk access is slow. Disk access is slow due to ???. Its problems all the way down. Its not just that you're low on ram. Its that you can't use the one way to mitgate that due to something else. – Journeyman Geek – 2012-03-29T13:35:04.993
7@JourneymanGeek, you are off in left field. Disks are slow compared to ram, period, hence heavy swapping always grinds the system to a halt. Of course he is out of memory because he tried running a program that uses a lot of memory. The question is what to do when out of memory? Kill the hog, or slow down due to having no memory left for the disk cache. – psusi – 2012-03-29T17:38:39.890
1@psusi: You don't understand how swap space works, with
slow down
being an assumption. We are all running page files and swap spaces world wide; and then you come with the suggestion to disable it, you have to explain a little bit more than that... – Tamara Wijsman – 2012-03-29T17:57:20.3002@TomWijsman, Disk IO is many orders of magnitude slower than memory IO, so using disk swap has always meant a huge slow down. Sometimes ( especially in the old days where ram was expensive and so most people didn't have much ) that's preferable to not being able to do what you were trying at all. These days the disk is SO much slower than ram, and ram is cheap enough that most people have plenty, so on the rare occasion where they accidentally run something that uses more ram than they have, it is often better to give up than take 1000 times as long to do it. – psusi – 2012-03-29T18:33:03.610
@psusi: You don't understand how disk swap works. If you think that "your memory is waiting on your disk" you either have a badly implemented kernel at your disposal or don't know what you are talking about. Your entire comment makes no sense as a result, please come with a theoretically backed up explanation instead of guessing... – Tamara Wijsman – 2012-03-29T18:59:41.890
1I would also like OOM killer to trigger a little earlier. Sometimes it is obvious that the I have overloaded my system, but it takes minutes of swapping and mouse/keyboard jitter before the killer acts. – joeytwiddle – 2013-01-18T06:23:07.873