Solved kernel: swap_pager: out of swap space

Code:
Nov 22 18:48:07 uninspiredhostname kernel: swap_pager: out of swap space
Nov 22 18:48:07 uninspiredhostname kernel: swap_pager_getswapspace(number): fail
Previous message repeated countless times.

So I'm building stuff in Poudriere and this keeps happening... I thought it was a bad RAM block, but it turns out it's running out of swap space...

Code:
sysctl -a | grep swap
1 PART ada0p2 5368709120 512 i 2 o 1048576 ty freebsd-swap xs GPT xt 516e7cb5-6ecf-11d6-8ff8-00022d09712b
z0xfffff80012b7fc00 [shape=box,label="SWAP\nswap\nr#4"];
            <type>freebsd-swap</type>
            <label>swap0</label>
      <name>swap</name>
vm.swap_enabled: 1
vm.disable_swapspace_pageouts: 0
vm.swap_idle_enabled: 0
vm.stats.vm.v_swappgsout: 0
vm.stats.vm.v_swappgsin: 0
vm.stats.vm.v_swapout: 0
vm.stats.vm.v_swapin: 0
vm.swap_idle_threshold2: 10
vm.swap_idle_threshold1: 2
vm.nswapdev: 1
vm.swap_async_max: 4
vm.swap_maxpages: 64926400
vm.swap_reserved: 3988832256
vm.swap_total: 5368709120

vm.swap_idle_enabled is set to 0 because apparently I can't set that in /boot/loader.conf, but it's supposed to be 1... at least, I think I'd like it to be 1...

How do I deal with this?
 
Stick more memory in the machine. Swap gets used when the system runs out of RAM. And apparently even RAM plus the amount of virtual memory isn't enough to cover it.

Yeah, but isn't there a way to tell FreeBSD to suspend stuff instead of crashing? Kill whatever's trying to use RAM like that?
 
Sure, but at some point there's nothing left to kill that isn't important for the sytem to keep running. But I personally would like to see something crash and burn because it ran out of memory instead of it being silently killed because the system needs the memory for something else.
 
Are you using ZFS ?
My machine has 8Gb memory and 12Gb swap. I had this kind of problem while building packages with ports-mgmt/poudriere.
I had to limit ARC memory used by ZFS by putting this in /boot/loader.conf:
Code:
vfs.zfs.arc_min="1G"
vfs.zfs.arc_max="4G"
 
Weird. My server used to have 8GB (I have since upgraded it to 16GB) with 4GB swap, it's using ZFS, Samba, MariaDB, a Java application, Transmission, a jail, a bhyve VM (puppet server) and I'm using it to build with poudriere. I never had memory issues and I've never needed to 'tune' anything. I only added the memory because I wanted to run more VMs.
 
Weird. My server used to have 8GB (I have since upgraded it to 16GB) with 4GB swap, it's using ZFS, Samba, MariaDB, a Java application, Transmission, a jail, a bhyve VM (puppet server) and I'm using it to build with poudriere. I never had memory issues and I've never needed to 'tune' anything. I only added the memory because I wanted to run more VMs.
Without this, mine goes out of swap. But I have to say that this machine is my main desktop computer and I am running poudriere while using it.
I had this problem when running FreeBSD 10.1 release, so I kept this tuning until now. I never tried without since I am on FreeBSD 11.1 release.
 
Sure, but at some point there's nothing left to kill that isn't important for the sytem to keep running. But I personally would like to see something crash and burn because it ran out of memory instead of it being silently killed because the system needs the memory for something else.

No, the whole system crashes...

Are you using ZFS ?
My machine has 8Gb memory and 12Gb swap. I had this kind of problem while building packages with ports-mgmt/poudriere.
I had to limit ARC memory used by ZFS by putting this in /boot/loader.conf:
Code:
vfs.zfs.arc_min="1G"
vfs.zfs.arc_max="4G"

For now I set it to build on the hard drive instead of in tmpfs... It's been building gtk2 and gtk3 at the same time for the past several hours... I think a line of code was added to the Perl makefile... : P
 
swappgsout /in showing unchanging very high swap numbers
vm.stats.vm.v_swapin: 347
vm.stats.vm.v_swapout: 52918
vm.stats.vm.v_swappgsin: 1435
vm.stats.vm.v_swappgsout: 747836

swapinfo
Device 1K-blocks Used Avail Capacity
/dev/swap 8388608 91564 8297044 1%

what is the expected behavior, not resting properly with respect swap usage .. please respond
 
Back
Top