hledger icon indicating copy to clipboard operation
hledger copied to clipboard

Fix infinite memory usage by allowing old data to be garbage collected

Open alerque opened this issue 2 months ago • 3 comments

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.

alerque avatar Oct 03 '25 22:10 alerque

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.

alerque avatar Oct 04 '25 16:10 alerque

I haven't had much quality hacking time just lately - but I am loving this burst of activity, will follow up asap!

simonmichael avatar Oct 04 '25 19:10 simonmichael

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.

alerque avatar Oct 06 '25 18:10 alerque