GC Metric for Pointer Count?

116 views
Skip to first unread message

Andrew Consroe

unread,
Aug 3, 2026, 8:22:59 PM (4 days ago) Aug 3
to golang-nuts
Reading an article on the design of the Green Tea collector the other day got me thinking about GC design more generally. One metric that could go into a GC design besides the total heap size is the total number of pointers into the heap. Because Go uses a pointer bitmap, I think this metric should be fairly easy (in theory) to access. I'd be interested to see what the ratio between heap size and pointer count is for various programs in production.

Andrew Consroe

unread,
Aug 5, 2026, 4:34:26 PM (2 days ago) Aug 5
to golang-nuts
I wrote a tool to inspect DWARF info for pointers in structs and posted it here: https://github.com/aconz2/elfptrs
It will show the percentiles of things like struct size, number of pointers, offset of those pointers, and successive difference of offsets
Of course we'd also need to know the relative frequency of allocation for each of those types, but it is a start
Reply all
Reply to author
Forward
0 new messages