Re: Signal 7 and "Couldn't get a free page..."

Bernd Schmidt (crux@Pool.Informatik.RWTH-Aachen.DE)
Tue, 29 Apr 1997 13:15:01 +0200 (MET DST)


> I'm getting "Couldn't get a free page..." even on machines with 32MB RAM
> and lots of unused swap. With 2.0.29 I never saw this on the affected
> machines...

I'm suspecting the buffer cache changes to be the real problem. The kernel
will only keep a certain number of unused buffer heads around with 2.0.30
(or 2.1 for that matter). The problem is that swapping out needs buffer heads.
In a low memory situation the kernel might decide to swap out a number of
pages asynchronously. It doesn't get free memory immediately, but the buffer
cache code may need many additional buffer heads to perform the swapout
(especially if page cache pages on a file system with a small blocksize are
synced: swapping out a normal page to a swap partition only takes one buffer).
This may cause the system to run completely out of free memory.
You can try to provoke this situation by writing a program that mmaps a large
file, writes to the mapping and then does a msync(..MS_ASYNC) (or simply
exits, since that will also cause a msync).

Bernd