Comment 35 for bug 159356

Revision history for this message
Bernd Kreuss (prof7bit) wrote : Re: System freeze on high memory usage

After having been affected by this for many years now and also observing that it seemed to get even worse with every new version (entire system freezing with heavy disk-IO as soon as it touches the end of the RAM, even ctrl+alt+f1 taking 5 minutes until console is switched, having to reboot multiple times per day as soon a firefox came aross a resource hungry website) today I tried again to find out whether this could be improved by tuning some of the various vm parameters and I might have finally found something: I have put the following line into my /etc/rc.local

sysctl vm.vfs_cache_pressure=100000

and since I did this and after a clean reboot today I have not had these immense problems anymore. This is the only vm parameter I have changed.

I have only 500MB of RAM on this laptop (running xubuntu 12.04) and here the problem could be easily reproduced: When browsing the web with firefox while already close to the limit of available RAM the memory usage sometimes can quickly spike by another 100 MB within milliseconds and then immediately the *entire* machine would have frozen. A few years ago a ctrl+alt+f1 would still have reacted within maybe 10 seconds (on the same laptop) but nowadays it seemed to take 5 minutes or didn't notice the key press at all sometimes.

After I set vfs_cache_pressure to 10000 (default is 100) I am not able to reproduce this extreme behavior anymore. Now it just starts using swap, applications becomimg slower but the complete freezing is almost gone, mouse pointer keeps being movable and my keyboard shortcuts to emergency kill some of my usual suspects still work in reasonable time (It almost seems I don't even need them anymore at all now).