Solved swap_pager_getswapspace(2): failed

gh_origin

Member

Reaction score: 22
Messages: 97

I tried to build a large codebase with g++ and it failed because cc1plus was killed. I checked dmesg and found it's full of these swap_pager_getswapspace(2): failed error and this:

Code:
pid 5941 (cc1plus), jid 0, uid 1001, was killed: out of swap space
I have 8G of RAM and 2G of swap. Ninja make jobs is default to 6 on my system. I will try to limit the make job to 4. My CPU has only 4 cores, don't know why ninja set make jobs to 6. Unless it considers hyperthreading to be physical cores then my CPU has 8.

p/s: What is ideal swap size for my system? I have installed FreeBSD on many machines, and regardless of their very diverted RAM size the FreeBSD installer always set swap to be 2G.
 
OP
G

gh_origin

Member

Reaction score: 22
Messages: 97

I found it's not used all of my swap space at all. top said there is only 154M used of my 2G swap space at most. So why it failed to get swap space?
 
OP
G

gh_origin

Member

Reaction score: 22
Messages: 97

After many trial and error, I found the suitable make jobs for GCC is -j3 on my system, which is number of physical cores - 1. Clang on the other hand, is fine with ninja's default -j6.
 
Top