jhawthorn / vernier

📏 next generation CRuby profiler
https://vernier.prof/
MIT License
839 stars 20 forks source link

Visualizing GC pause and thread running #83

Open alexcwatt opened 3 months ago

alexcwatt commented 3 months ago

Thank you for this gem! I've recently started using it to analyze a system.

I'm curious about GC pause reporting. In the screenshot below, a particular thread is shown as running (not stalled) but some of the frames where it's shown as running are frames with a GC pause:

image

If I'm understanding correctly, the thread isn't actually running when there's a GC pause; I was wondering if there would be another way to represent this visually? The current definitions of thread stalled and suspended don't seem to fit the GC pause scenario, but maybe there is some way to make it more apparent that the thread is not running?

I could also be misunderstanding. Thank you for any insight you can add!

jhawthorn commented 3 months ago

The thread markers represent the current GVL state, so what's being shown is accurate (though I agree not completely intuitive), the thread has the GVL and is "running", but the thing that it's running is the garbage collector.

I am open to changing/adjusting this if there's a definition that makes more sense. One other limitation is that currently I believe I only put the GC information inside the main thread which can be confusing in the other threads (which may be the cause of the allocation which triggered GC)

Also, since you have one of the most GC-heavy profiles I've ever seen 😅, I'd love to know whether https://github.com/jhawthorn/vernier/pull/67 makes your flame graph and stack chart more or less obvious as to what is happening in the program.