ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

This is a classic gcc error, it happens when the system runs out of memory.

The most conservative way I found to make it work (almost always) in those situations is decreasing the number of threads of the compiler and also configuring the parameter "ggc-min-expand" to some convinient value.

Specifically this would translate to colcon as the following example command line:

colcon build --parallel-workers 1 --cmake-args -DCMAKE_CXX_FLAGS="--param ggc-min-expand=20"

This will make the compilation slower but it maximum memory it takes will be lower.

Generalizing the answer to ROS1 the example would be:

 catkin_make -j 1 -DCMAKE_CXX_FLAGS="--param ggc-min-expand=20"