https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70768
--- Comment #3 from Markus Trippelsdorf <trippels at gcc dot gnu.org> --- (In reply to James Almer from comment #2) > (In reply to Markus Trippelsdorf from comment #1) > > Well, you simply need more RAM to compile this testcase, because gcc-6 uses > > slightly over 2GB peak, so your machine starts swapping. > > On my machine (with 8GB RAM) gcc-6 is actually slightly faster. > > > > (For gcc-7 you need to configure it with --enable-checking=release to > > compare timings.) > > Tried to assign more RAM to the vm and it indeed fixed the trashing and > slowness with gcc-6 and newer. > > gcc-6/7 uses like 2.1GB of RAM to compile this file whereas gcc-5 uses only > 1.6GB. Is this intended/expected, or can it be considered a memory hog? Maybe. gcc-5: phase lang. deferred : 66.28 (84%) usr 2.57 (69%) sys 68.88 (83%) wall 2722388 kB (82%) ggc phase opt and generate : 12.25 (15%) usr 0.92 (25%) sys 13.19 (16%) wall 469818 kB (14%) ggc phase finalize : 0.00 ( 0%) usr 0.00 ( 0%) sys 0.01 ( 0%) wall 0 kB ( 0%) ggc |name lookup : 1.80 ( 2%) usr 0.12 ( 3%) sys 1.99 ( 2%) wall 279075 kB ( 8%) ggc |overload resolution : 58.89 (74%) usr 2.53 (68%) sys 61.26 (74%) wall 2619094 kB (79%) ggc template instantiation : 60.34 (76%) usr 2.66 (72%) sys 62.90 (76%) wall 2791073 kB (84%) ggc TOTAL : 79.35 3.72 83.14 3325932 kB gcc-6: phase lang. deferred : 74.36 (87%) usr 3.38 (72%) sys 77.73 (86%) wall 3725459 kB (84%) ggc phase opt and generate : 10.30 (12%) usr 1.17 (25%) sys 11.46 (13%) wall 572078 kB (13%) ggc |name lookup : 2.18 ( 3%) usr 0.27 ( 6%) sys 2.19 ( 2%) wall 134001 kB ( 3%) ggc |overload resolution : 62.60 (73%) usr 3.25 (69%) sys 66.14 (73%) wall 3543436 kB (80%) ggc template instantiation : 64.42 (75%) usr 3.42 (72%) sys 67.78 (75%) wall 3798026 kB (86%) ggc TOTAL : 85.52 4.72 90.24 4424695 kB