As marino@ has pointed out, the question and information will probably be lost in the 35 plus page synth thread, so I've taken the liberty of copying my original post, and the responses.
pquote]
Synth using memory till swap is full
I see that someone had this issue back with FreeBSD-10.x, where synth started using swap at an unexpected rate. https://forums.freebsd.org/threads/56171/ Lately, this has started happening to me on 2 FreeBSD-11 systems, both with reasonably good processors, zfs, and 8 GB of RAM. Adding a second swap partition didn't help. This seems to happen when building large packages, such as libreoffice, however, using portmaster or just doing make install from a port doesn't do this--it will use a lot of CPU, but swap stays at unused or just a little bit used. This happens when I run synth prepare-system. I haven't seen any mention of it save for that one thread I linked, so it may be one of those Just Me(TM) things, but I do see it on two different machines. I see swap gradually climbing till it reaches 100 percent and the machine becomes unresponsive. Logs show things like
[/quote]
marino@ responded
There are 2 possibilities:
For what it's worth, I used defaults, and looking through logs I don't see any watchdog errors. This may mean more work in tracking down a memory leak than I have the ability (or time) to do right now.
@fernadel posted
I had the same problem still, now on FreeBSD 11-RELEASE. Not many times but it happened.
Not so long I use Synth and at the same time it built LibreOffice and Blender. SWAP raise to 36% and after LibreOffice was done dropped to 13.6%. And when was everything done swap stayed on 13%??
abishai posted
8Gb of ram is not enough for synth on my system. When 2 builders start to build Firefox/Thunderbird it starts swapping heavily and eventually system crashes. I disabled tempfs for workarea in Synth config and everything runs smoothly after that.
marino@ replied
how much swap do you have? maybe you find a cheap 64gb or higher SSD and use that (assuming we're not talking about a space constrained machine like a laptop here).
The original problem was likely your swap partition was way too small, but if the swap is a spinning disk, it's not much better than just turning off tmpfs for the workspace.
alternatively, you can shift the synth build root to an SSD partition so that building without tmpfs won't be such a big performance hit.
And I posted
Today I started a synth update, but first tried limiting vfs.zfs.arc_max from its default of RAM minus 1 GB to about 4 GB. I think something is leaking memory, but don't have the expertise to track it down. In my case (on a ZFS mirror in one case, on a single ZFS disk pool in another--haven't tried on that machine yet), it may have fixed the issue, with swap, so far, staying below 30%, though there are still many packages left to go. I'll update when the build is complete.
So, putting this in this new thread (some posts above have been somewhat edited) in case others run into the problem as there are two possible fixes listed, abishai and mine.
TLDR; From the synth thread, I posted about swap getting completely used, and I've posted the responses here, which include two solutions that have worked for two individuals.
pquote]
Synth using memory till swap is full
I see that someone had this issue back with FreeBSD-10.x, where synth started using swap at an unexpected rate. https://forums.freebsd.org/threads/56171/ Lately, this has started happening to me on 2 FreeBSD-11 systems, both with reasonably good processors, zfs, and 8 GB of RAM. Adding a second swap partition didn't help. This seems to happen when building large packages, such as libreoffice, however, using portmaster or just doing make install from a port doesn't do this--it will use a lot of CPU, but swap stays at unused or just a little bit used. This happens when I run synth prepare-system. I haven't seen any mention of it save for that one thread I linked, so it may be one of those Just Me(TM) things, but I do see it on two different machines. I see swap gradually climbing till it reaches 100 percent and the machine becomes unresponsive. Logs show things like
Code:
09:28:47 s kernel: swap_pager: out of swap space
Dec 26 09:28:47 s kernel: swap_pager_getswapspace(5): failed
Dec 26 09:32:50 s kernel: swap_pager_getswapspace(16): failed
Dec 26 09:32:50 s last message repeated 6 times
Dec 26 09:32:50 s kernel: swap_pager_getswapspace(12): failed
Dec 26 09:32:50 s kernel: swap_pager_getswapspace(16): failed
Dec 26 09:32:50 s kernel: swap_pager_getswapspace(12): failed
Dec 26 09:32:50 s kernel: swap_pager_getswapspace(16): failed
Dec 26 09:32:50 s kernel: swap_pager_getswapspace(12): failed
Dec 26 09:32:50 s kernel: swap_pager_getswapspace(16): failed
Dec 26 09:32:50 s kernel: swap_pager_getswapspace(12): failed
Dec 26 09:32:50 s kernel: swap_pager_getswapspace(16): failed
marino@ responded
There are 2 possibilities:
- you've set too many builders + jobs for the resources you have for every case
- you've got a leak somewhere. Something is using but not releasing swap space. grep log directory for watchdog failures to see if those are happening (they really should never happen).
For what it's worth, I used defaults, and looking through logs I don't see any watchdog errors. This may mean more work in tracking down a memory leak than I have the ability (or time) to do right now.
@fernadel posted
I had the same problem still, now on FreeBSD 11-RELEASE. Not many times but it happened.
Not so long I use Synth and at the same time it built LibreOffice and Blender. SWAP raise to 36% and after LibreOffice was done dropped to 13.6%. And when was everything done swap stayed on 13%??
abishai posted
8Gb of ram is not enough for synth on my system. When 2 builders start to build Firefox/Thunderbird it starts swapping heavily and eventually system crashes. I disabled tempfs for workarea in Synth config and everything runs smoothly after that.
marino@ replied
how much swap do you have? maybe you find a cheap 64gb or higher SSD and use that (assuming we're not talking about a space constrained machine like a laptop here).
The original problem was likely your swap partition was way too small, but if the swap is a spinning disk, it's not much better than just turning off tmpfs for the workspace.
alternatively, you can shift the synth build root to an SSD partition so that building without tmpfs won't be such a big performance hit.
And I posted
Today I started a synth update, but first tried limiting vfs.zfs.arc_max from its default of RAM minus 1 GB to about 4 GB. I think something is leaking memory, but don't have the expertise to track it down. In my case (on a ZFS mirror in one case, on a single ZFS disk pool in another--haven't tried on that machine yet), it may have fixed the issue, with swap, so far, staying below 30%, though there are still many packages left to go. I'll update when the build is complete.
So, putting this in this new thread (some posts above have been somewhat edited) in case others run into the problem as there are two possible fixes listed, abishai and mine.
TLDR; From the synth thread, I posted about swap getting completely used, and I've posted the responses here, which include two solutions that have worked for two individuals.
Last edited: