Ubuntu 10.04 LTS – experimenting with overcommit

I currently running Ubuntu 10.04 LTS as my desktop. Neither Unity nor GNOME Shell (in GNOME 3) really interest me, but that’s for another post! This one is about the exasperation I feel when Linux overcommits too much memory and then goes into disk-thrashing hell.

It happens when I open just ‘one-too-many’ tabs in Chrome. The desktop becomes unresponsive as the memory manager in Linux tries to find pages for Chrome to use for the new tab. Unfortunately, it’s so overcommitted the pages that it can’t find any. Every process wants to run and Linux essentially runs out of pages. Hence disk-thrashing starts, the desktop slows to a crawl or simply becomes unresponsive, and I try to Ctrl-Alt-F1 to get to a TTY so I can kill something (usually ‘killall chrome’).

I’d rather the box just didn’t allocate the memory if it doesn’t have it – i.e. don’t open the new tab if there isn’t memory for it.

My experiment is going to be to run for a few weeks using some sysctls of:

This should give me a maximum commit of 8GB (4Gb swap and 4GB of memory). I wonder how it will go?

Useful information from: