Running out of memory (sort of)
Thu, 31 Jul 1997 14:05:53 -0400 (EDT)

Hi. The recent discussion on running out of memory reminds me of some of
the problems i've had, so i thought i'd bring 'em up.

Using both 2.0.30 and 2.1.42, after a while of uptime, i'll run low on
physical memory, as reported in /proc/meminfo under MemFree. My system is
generally lightly loaded, but i do have one daemon, which continuously
chooses random sound files and plays them. Under these "low memory"
conditions, the sound playing daemon sometime reports "Out of memory"
errors. My solution under these conditions is to run a program called
"swapout" that comes with the ftape distribution.

According to ftape documentation, ftape needs a buffer of 32K of continuous
physical memory, and:

The physical RAM of
the computer, however, is organized in entities of 4Kb, so called
"pages". This means that it might be very well the case that there
is indeed plenty of free RAM on your computer system, but the RAM
is fragmented in a way that the OS (Linux) is unable to provide
pieces of 32Kb of continuous memory.

To cope with this problem, there exists a small and ugly, but useful,
utility called `swapout', which does nothing but allocate a huge chunk
of memory, dirty all pages (i.e. force the OS to really allocate those
pages) and exit. This forces the Linux kernel to swap out quite a lot
of RAM. As a result, the physical RAM of the computer gets

Since swapout seems to also fix my sound problems, i surmise that the sound
module has similar problems.

Is there any way for you kernel hackers to incorporate this functionality
into the kernel? Say, maintain a certain-sized pool of continuous memory
(settable) for requests by modules, or some other idea with similar
consequences? TIA.

			     Mordechai T. Abzug   finger -l
>>>>> My employer ain't payin' for my opinions, so they must be *mine*. <<<<<
If God meant us to go around naked, we'd be born that way.