Linux not using swap, but OOM killer is triggered

linuxswap

I've been having this problem for a long time now, and I can't seem to figure it out, basically, my linux (32bit 3.2.6-3.fc16.i686.PAE) system is refusing to use the swap. When I run

$ tail /dev/zero
tail: memory exhausted

it does not resort to using the swap at all.. it just dies after using up the physical RAM. Here are the relevant details.

$ free -m
             total       used       free     shared    buffers     cached
Mem:          8076       4652       3423          0        123        543
-/+ buffers/cache:       3985       4090
Swap:         8192        116       8076


$ cat /proc/sys/vm/swappiness 
60

$ ulimit -m
unlimited

$ cat /proc/sys/vm/overcommit_ratio
50

$ cat /proc/sys/vm/overcommit_memory 
0

I tried setting it to 1:

# sysctl vm.overcommit_memory=1
vm.overcommit_memory = 1


$ cat /proc/sys/vm/overcommit_memory 
1

and tried again, same result. Any ideas?

Best Answer

It is 32-bit Linux, therefore there is no way to allocate more than 4GiB memory for an application, because it'll exhaust its address space. You have 8GiB RAM, and it is mostly free, so 4096 MiB can be allocated w/o use of swap.

Related Question