Open nolanlawson opened 2 years ago
I don't think it would be possible to rely on the retainer chain, for a few reasons:
Even though it's dumb, I kind of like the iterations approach because it also helps filter out temporary caches. E.g. if you have a LRU cache of size 5, then 7 iterations will not surface that.
The "count the objects" technique is usually pretty good at finding the "head vampire" (root of the retainer chain), but it's not always perfect. fuite could potentially show the actual retainer chain for these objects.
My only hesitation about this is that I feel like it devolves into reimplementing the Chrome DevTools, in particular the UI for diffing heap snapshots, whereas I already have instructions where you can diff your own heap snapshots in
--debug
mode.