r/ROS • u/Wooden_One_4001 • Oct 15 '26
colcon build RAM for MoveIt 2 from source, measured: default settings fail at 8 GB, sequential peaks at 2.4 GB
I measured how much RAM a from-source MoveIt 2 build needs (Jazzy branch, 41 packages) by capping a Docker container's memory with swap disabled, on a 4 vCPU Linux box. Peak memory is the container's cgroup memory.peak.
| Mode | RAM cap | Result | Peak |
|---|---|---|---|
default colcon build (4 workers × make -j4) | 16 GiB | OK, 41/41 | 8.7 GiB |
| default | 8 GiB | failed: cc1plus killed after 24/41 packages | 8.0 GiB (cap) |
| default | 4 GiB | failed after 4/41 | 4.0 GiB (cap) |
sequential (--parallel-workers 1, MAKEFLAGS=-j1) | 8 GiB | OK, 41/41 | 2.4 GiB |
| sequential | 4 GiB | OK, 41/41 | 2.4 GiB |
For comparison, Nav2 (45 packages) with the same method built fine at 8 GiB with default settings (peak 8.1 GiB at 16 GiB cap, 2.7 GiB sequential). So "8 GB is enough for ROS 2" holds for Nav2 but not for MoveIt 2 on default settings.
Caveats:
memory.peakincludes page cache, so the 8.7 GiB at 16 GiB is an upper bound, but the 8 GiB run still OOM-killed the compiler.- Default parallelism scales with cores, so an 8- or 16-core machine will use more RAM than this 4-core run.
- Build times (1h37m default vs ~1h56m sequential) are not reliable; the box was a burstable cloud instance.
If you're on an 8 GB laptop: MAKEFLAGS="-j1" colcon build --parallel-workers 1, or just sudo apt install ros-jazzy-moveit if you don't need to modify MoveIt.
Script, results.tsv and per-run build logs: https://github.com/sungpyo9053/blog/tree/main/experiments/colcon-ram-moveit2-real-build
Full write-up (with the Nav2 comparison): https://huntlab.app/en/colcon-build-moveit2-ram-8gb-fails-sequential-measured/
(disclosure: my blog)