https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119705
--- Comment #6 from Richard Biener <rguenth at gcc dot gnu.org> --- Created attachment 61060 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=61060&action=edit -fmem-report with detailed-mem-stats and -fsyntax-only -fmem-report with details shows tree_list 7699k tree_vec 12M Hash maps Leak Peak Times Type -------------------------------------------------------------------------------------------------------------------------------------------- cp/cp-gimplify.cc:2989 (cp_fold) 132M: 97.6% 132M 35k: 1.7% ggc Heap vectors sizeof(T) Leak Peak Times Leak items Peak items symtab.cc:635 (create_reference) 8 1713k:16.4% 1713k 54847:20.3% 214k 214k symtab.cc:627 (create_reference) 40 8574k:81.9% 8574k 54874:20.3% 214k 214k GGC memory Leak Garbage Freed Overhead Times cp/semantics.cc:511 (perform_or_defer_access_che 0 : 0.0% 40M: 2.2% 890k: 0.1% 54k: 0.0% 299k cp/pt.cc:13916 (tsubst_pack_expansion) 0 : 0.0% 65M: 3.6% 0 : 0.0% 0 : 0.0% 1671k cp/pt.cc:14190 (tsubst_argument_pack) 7141k: 0.2% 118M: 6.5% 0 : 0.0% 0 : 0.0% 766k cp/pt.cc:9090 (coerce_template_parameter_pack) 26M: 0.8% 82M: 4.5% 0 : 0.0% 0 : 0.0% 663k cp/pt.cc:9280 (coerce_template_parms) 16M: 0.5% 97M: 5.4% 200k: 0.0% 0 : 0.0% 3204k ... cp/pt.cc:15441 (tsubst_decl) 136M: 4.0% 34M: 1.9% 0 : 0.0% 0 : 0.0% 1281k tree-inline.cc:5704 (copy_tree_r) 169M: 5.0% 82M: 4.5% 0 : 0.0% 54k: 0.0% 6853k cp/pt.cc:14832 (tsubst_function_decl) 175M: 5.1% 576 : 0.0% 288 : 0.0% 19M: 12.4% 623k cp/class.cc:5162 (copy_fndecl_with_name) 195M: 5.7% 925k: 0.0% 0 : 0.0% 21M: 13.9% 698k stringpool.cc:43 (stringpool_ggc_alloc) 240M: 7.0% 0 : 0.0% 0 : 0.0% 53M: 34.3% 197k template processing tends to create a lot of TREE_VEC garbage. But it's done all over the place it seems.