The on-disk hash table for the memprof writer holds copies of all the memprof records to be written. These hold a lot of memory in aggregate, due to the lists of alloc sites (which each have a list of context frames) and call sites. Clear each one after emitting it. This drops the peak memory when writing a very large indexed memprof profile by about 2.5G.
30 KiB
30 KiB