Re: Memory overcommit

From: Vedran FuraÄ
Date: Fri Oct 30 2009 - 11:13:35 EST


Thomas Fjellstrom wrote:

>> malloc: Cannot allocate memory /* Great, no OOM, but: */
>>
>> % free -m total used free shared buffers cached
>> Mem: 3458 3429 29 0 102 1119
>> -/+ buffers/cache: 2207 1251
>>
>> There's plenty of memory available. Shouldn't cache be
>> automatically dropped (this question was in my original mail, hence
>> the subject)?
>>
>
> I think this is the MOST serious issue related to the oom killer. For
> some reason it refuses to drop pages before trying to kill. When it
> should drop cache, THEN kill if needed.

This isn't about OOM, but situation when you turn off overcommit. I was
jumping to conclusion here. You can drop caches manually with:
# echo 1 > /proc/sys/vm/drop_caches

but you still get: "malloc: Cannot allocate memory" even if almost
nothing is cached:

total used free shared buffers cached
Mem: 3458 2210 1248 0 3 90
-/+ buffers/cache: 2116 1342

As for not dropping pages by kernel before killing, I don't know nothing
about it. It happens so fast and I never tried to measure it.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/