g++ "fatal error: Killed signal terminated program cc1plus" in CI
By Kaveh Alemi·Latchkey
When a compile exceeds available memory the kernel OOM killer kills cc1plus, and g++ reports "fatal error: Killed signal terminated program cc1plus". The fix is to reduce peak memory per compile.
What this error means
A heavy translation unit or high parallel job count makes the build die with the Killed cc1plus message, often only on smaller runners.
g++
c++: fatal error: Killed signal terminated program cc1plus
compilation terminated.
make[2]: *** [CMakeFiles/app.dir/big.cpp.o] Error 1
Common causes
How to fix it
Lower the parallel job count
Reduce the number of concurrent compiles so total memory fits the runner.