revolution-irc
revolution-irc copied to clipboard
Memory leak
It looks like I have a memory leak in the application... Just after starting the application the memory usage is just above 100MB. After leaving the application for a day it starts to consume over 200MB. One time the application crashed because of an out of memory error, with the application trying to consume over 600MB.
MainActivity was leaked as a result of a bug I fixed in https://github.com/MCMrARM/revolution-irc/commit/564a5794058c9d719efabdca668363001243a437. I am unsure if this is the only leak that was there.
Found another leak. Someone decided that it'd be a great idea that SpannableString's constructor would copy NoCopySpans (SpannableStringBuilder's does not copy them though). It ended up copying a TextView.ChangeWatcher span which has a reference to the TextView that contained the text and that TextView had a reference to an Activity. Fixed with https://github.com/MCMrARM/revolution-irc/commit/2d7cad9ddbdc5fd7780d233ed9e53118becbbb03
I don't think anything else leaks MainActivity so I'll close this for now. If I'll see any other memory leak I'll reopen it.
Unfortunately it looks like there is another memleak (perhaps of the SQLite database handles), as the app uses >150MB again.
There is reference to context in singleton .config.SettingsHelper. I think this might be one of the source of leak.
No, that is fine.