https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81818
--- Comment #4 from Andrew Roberts <andrewm.roberts at sky dot com> --- Looking at --param ggc-min-expand and --param ggc-min-heapsize For gcc 8.0.0: on arm with 1Gb RAM: GGC heuristics: --param ggc-min-expand=93 --param ggc-min-heapsize=119808 on aarch64 with 1Gb RAM: GGC heuristics: --param ggc-min-expand=88 --param ggc-min-heapsize=109859 So these are already slightly lower on aarch64, than on arm (presumably due to less RAM being free after kernel usage, 789M vs 889M on arm). Looking at individual optimizations: as -O2 uses much more memory than -O1, I figured out the optimizations that differed, and tried building at -O2 with each of these optimizations disabled one by one. The most any one optimization reduced the memory footprint by was 4%. So no smoking gun there. The optimizations for -O2 are the same for arm and aarch64.