Fix infinite memory usage by allowing old data to be garbage collected
Fixes #1825
... at least the increasing memory usage on each press of g is fixed by making new data structures and allowing the old data to be garbage collected. I'm not sure about CPU usage as that did not go up appreciably in my repro for this issue, and I haven't tested this long enough to know if it also solves the ‘leave running for days’ variant of the problem rather than the repeated manual refresh variant, but it seems likely it will.
See issue comments for updates on testing, I did do a longer term run test and got more conclusive results than the initial speculation here.
I haven't had much quality hacking time just lately - but I am loving this burst of activity, will follow up asap!
I just converted this to a draft again because the latest commits here have not been properly vetted. I'm hacking wildly trying to make out where the leak(s) are. The current iteration runs much better for me including not leaking memory from the registry screen, but I haven't reasoned through everything enough to verify functionality won't have been lost.