Chatterino has a memory usage problem
Describe your issue Chatterino either leaks or retains too much memory for something. Memory usage seems to increase over time, but not linearly - for example my current chatterino instance uses 1.67GB private bytes for 3d3h runtime.
Applications like MTuner might help to find the cause.
Screenshots

OS and Chatterino Version Win10 20H2 19042.1052 Chatterino Nightly 2.3.2 (commit f9ddd5303, )
Maybe the debug popup (F10) can help.
cf. my one, after a day or so of running

lots of message layout elements

I'm sure messages are leaked somewhere (I had no channels but there were messages) but I can't replicate it consistently.
This might be the bug? When messages scroll off the split, they aren't properly deleted. Their Layout Elements stay leaking memory. However they are deleted as soon as the split/channel is.
Yeah, seems like it. I deleted and recreated a couple of splits and managed to get it down to 700k, but I see the number going down sometimes, so there are situations where layout elements are deleted
Is it maybe related to the amount of loaded animated images?
In your screenshot you have 1800 animated images, and my own count of 837 animated images puts my mem usage at 900 MB.

You describe that you delete splits, and I get the same memory reduction behavior by closing them when I have a lot of animated images loaded by each split.
I test this by going into channels with a lot of animated BTTV emotes and opening up the emote window and my memory usage consistently goes up and stays that high until I close the tab: https://streamable.com/eqxqcn
Yes I'm also experiencing this high ram usage. As noticed today, my ram usage was up to 1.6gb. After restarting, it dropped down to 600mb.
When I started testing it, I was on 400mb after a fresh restart with emote hover and link previews turned off. @KararTY suggested I open emote windows in all splits to load the animated emotes. I'm now at 944mb (this didn't change from me going afk):

I went through all my splits today running the !bttvemotes command. I've been at home all day and had chatterino running. 390mb of ram being used. After running said commands, I'm now up to 1gb being used.


I reached 1.5G of memory today

1.83GB with lower statistics except drawing buffers

~4.3GB, seen it sit around 5GB later on in the day.~
Ignore that, it's actually 526MB after 10 mins

Isn't most of the memory used because of the amount of images and animated images you have loaded into ram?
For example I start chatterino and it uses 60mb and then open the emote picker in zneix chat and memory usage goes up to 222mb. I expect this to be worse if you have a lot of tabs open and people use the emotes and sub emotes and if you have 7tv.
A little bit of a useless bump. IMO Chatterino should free unused images from memory but keep the cache and just reload from it. This could save us like half the usage of a high-uptime instance by my guesstimating.
or memory map the files?
I have an instance right now that is on 3.23GB private bytes
It might be worth doing something like unloading all emotes in a chat if you haven't looked at a split of that chat in the past 5 min or something similar. This approach might cause too much disk read though. Also might be very hard to implement, unsure.
Memory mapping might also be a good approach, but only really works if emotes have a lot of overlap between channels. I suspect the biggest issue are the animated emotes and do most channels have similar ones?
Memory mapping might also be a good approach, but only really works if emotes have a lot of overlap between channels. I suspect the biggest issue are the animated emotes and do most channels have similar ones?
While there are a lot of channel-unique animated emotes, a lot of the common ones are still shared across hundreds or thousands of chats. I suspect that this would make a pretty noticeable difference.
Another possible optimization: instead of always pulling default for twitch emotes, could just cache static if the animateEmotes setting is disabled (tho extra logic is needed if the option is toggled)
with PR #3915 I still have an instance with 1.78GB usage, process started 3 days and 9 hours ago
4 days and 5 hours ago: 2.02GB
a week ago: 2.6GB

with PR #3915 I still have an instance with 1.78GB usage, process started 3 days and 9 hours ago
keep it running and see how it increases :smiling_imp:
I have reached 2.78GB with 11 days uptime before I wanted to play BeamNG.Drive so I had to restart chatterino
We're more aggressive about releasing emotes now, closing this but feel free to re-open it if you feel like the latest nightly is still eating your memory like crazy.