Skip to content

Enable heap profiling with the non-moving collector

Motivation

Currently heap profiling isn't supported with the non-moving collector. But it would be quite helpful to have this.

Proposal

I think the main thing that is needed is for the heap profiler to be taught to traverse non-moving segments. I think the logic for segments just after a major gc is something like the following:

  • Full: every block is live
  • Active: marked blocks are live
  • Current: marked blocks are live as well as everything before the allocation pointer.

We also need to be careful that it traverses large objects that live on the non-moving heap.

I think I could implement this.

I'm not quite sure if concurrent collection would have to be disabled if heap profiling is enabled. As I understand it, when concurrent collection is enabled, the non-moving gc only gives us a conservative view of what is alive on the heap. Perhaps that's ok, or perhaps we want to disable concurrent collection when heap profiling is enabled.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information