A few more notes:
I could reproduce the bug with 6.10.4.
When profiling, there is roughly ten times more allocation happening, which gets attributed to the program. Nevertheless, even when running a normal build the program allocates around 4.6GB here, and I don't see where all that allocation comes from.