https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55442
Jason Merrill <jason at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jason at gcc dot gnu.org --- Comment #2 from Jason Merrill <jason at gcc dot gnu.org> --- (In reply to David Fendrich from comment #0) > My guess is that this has something to do with unlimited memoization? Yes. GGC memory Garbage Freed Leak Overhead Times -------------------------------------------------------------------------------------------------------------------------------------------- [...] cp/constexpr.c:1761 (cxx_eval_call_expression) 0 : 0.0% 0 : 0.0% 73M: 18.5% 0 : 0.0% 2340k cp/constexpr.c:1420 (cxx_bind_parameters_in_call 182M: 96.7% 0 : 0.0% 182M: 46.2% 0 : 0.0% 9362k Both of these are involved with caching the values of constexpr calls. Looking at the code, it seems that we do the second allocation even when we get a cache hit, and then don't free it, so it builds up until we can do GC later.