Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 13 Sep 2005 09:16:01 +0200
From:      Martin Hedenfalk <martinh@servicefactory.se>
To:        freebsd-questions@freebsd.org
Subject:   Swapless system: processes killed in favor of disk cache?
Message-ID:  <0fba7a7ededb5920029abeea87308d2c@servicefactory.se>

next in thread | raw e-mail | index | archive | help
Hello list,

We're running a swapless FreeBSD 4.10 system. Although we do have a 
disk in this particular system, it is currently not used as swap.

The problem we're experiencing is that when storing a large file on the 
disk, a lot of memory is used (same as the size of the file). This 
leads to random processes being killed with an "out of swap space" 
message.

Running top when dd'ing 30 MiB from /dev/zero to a file on disk shows 
free memory dropping 30 MiB, and Inact and Wired combined increasing 
for the same amount.

I was able to change this behaviour by opening the file with the 
O_DIRECT flag. But this only fixes one problem in one particular 
application, and I'd like to understand what is actually going on.

So, is all this memory used for disk cache? If so, why is it not 
invalidated when a process wants to allocate memory?

Are there any sysctl's that controls this behaviour? I've tried setting 
vm.swap_enabled=0,  vm.defer_swapspace_pageouts=1, and 
vm.disable_swapspace_pageouts=1.

Thanks in advance
Martin Hedenfalk




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?0fba7a7ededb5920029abeea87308d2c>