Re: OOM policy, overcommit control, and soft limits

Previous thread: [PATCH 2.6.25.4] hwmon: HP Mobile Data Protection System 3D ACPI driver by Yan Burman on Saturday, May 31, 2008 - 8:05 am. (27 messages)

Next thread: [patch 0/2] MTD: use list_for_each_entry() by matthias on Saturday, May 31, 2008 - 9:28 am. (1 message)
To: Chris Frey <cdfrey@...>
Cc: <linux-kernel@...>
Date: Saturday, May 31, 2008 - 8:48 am

I'm not sure how helpful this is. It sounds like you may be missing
something, but I'm not competent to explain it. But here are some of
my thoughts.

1. If your system is really running away, maybe killing the processes
responsible is a good idea.

2. Why do you want to set an _overcommit_ soft-limit at 90% of RAM?
Even without swap, that sounds very restrictrive.

If I naively add up the top 10 memory hogs on my 512M system, they're
using a total of over 4G of virtual memory. (And I have less than
512M swap). Some of that will be shared memory or backed by disk
files - but I don't think that it can account for all 3G of the
overcommit. Shared memory tends to be code only, and my entire "disk"
is only 4G.

In other words, I reckon I have on the order of a gigabyte of virtual
address space, which has been malloc'ed or equivalent, but is not used
and therefore requires no memory resource (ram or swap).

3. Personally, without knowing whether it's already done, I think a
significant solution for the desktop is for browsers, mail clients and
similar to place strict limits on their anonymous memory consumption,
and use mmaped files for the caches / object stores which can grow so
large. Similarly, the GIMP uses a "tile cache" file (which perhaps
shows its age). If applications are storing caches on disk, they
should make this clear to the kernel - using mmapped files for cache
effectively turns them into swap files, letting the kernel page them
out to disk without using up the kernel swap file. Exposing the cache
memory usage on disk also makes it slightly more accessible, e.g. to
disk quotas, or users with "du".
--

To: Alan Jenkins <aj504@...>
Cc: Chris Frey <cdfrey@...>, <linux-kernel@...>
Date: Saturday, May 31, 2008 - 11:23 am

No need to reckon. The committed_as in the proc file should give a rough
value.

Alan
--

To: Alan Cox <alan@...>
Cc: Alan Jenkins <aj504@...>, Chris Frey <cdfrey@...>, <linux-kernel@...>
Date: Saturday, May 31, 2008 - 12:45 pm

Thanks for the education. I shall read up on the other numbers in
/proc/meminfo as well.

In that case I was overly pessimistic. I was only committed around the
512M mark. It jumps up to 750M if I open Amarok and Firefox though. At
times I've run more - I would guess I can contrive combinations which go
above 1000M.

I've not had an OOM event on this machine. I have had runaway
development-related loads, causing thrashing (hitting swap) out of
control, but I can't really comment. I don't remember what caused it
exactly. Plus I'm swapping to a Flash drive; a Flash specific IO
scheduler might have coped better (than noop) and made it easier to recover.

Alan
--

Previous thread: [PATCH 2.6.25.4] hwmon: HP Mobile Data Protection System 3D ACPI driver by Yan Burman on Saturday, May 31, 2008 - 8:05 am. (27 messages)

Next thread: [patch 0/2] MTD: use list_for_each_entry() by matthias on Saturday, May 31, 2008 - 9:28 am. (1 message)