You have to play with the garbage collector settings. The parameters are ggc-min-expand
and ggc-min-heapsize
. Also set your ulimit with ulimit 65536
(or whatever) to reduce the heap size (RLIMIT_AS).
Lots of information on that in the gcc manual here
A good setting may be to set the ggc-min-expand param to 0 and ggc-min-heapsize param to 8192 and try with that...
CXXFLAGS="$(CXXFLAGS) --param ggc-min-expand=0 --param ggc-min-heapsize=8192" or some such value.