Open DefCon-007 opened 3 years ago
Is this true regardless of which plugins you use or can it be isolated to a particular plugin?
Have not tried with correlating with a plugin but I went through the code of all four plugins and didn't see anything there. Is there any direct way to isolate memory profiling of each plugin? If not, would be good feature ensuring long term sustainability and easier maintenance of xbar.
i'm running only one plugin that i wrote myself (adapted from the ssh tunnel plugin). at first, xbar uses ~50Mb of ram, but it seems to sometimes balloon to 1Gb.
Is it sometimes or always? 😄
Memory footprint seems to be continuously growing. 4 hours ago it was ~50Mb, now it's ~90Mb (all according to Activity Monitor).
I'm also seeing high memory usage. With one plugin installed, after a few days xbar is over 1.2GB of memory usage.
This doesn't seem to be plugin-specific. I didn't find this ticket before so I ended up opening a new one with some more technical details in https://github.com/matryer/xbar/issues/731, the underlying problem should be the same.
@Etheryte Thank you for such detailed explanation, for the time being I had to completely stop using the app as after sometime it was making my complete system unusable. Looking for more inputs so that we can fix this as soon as possible.
I'll be addressing this over the next week. Thanks for your patience 👍
This is fixed by #731
@DefCon-007 Any chance you can confirm this?
@matryer I didn't get a chance to test again. I am on vacation and will be able to take a look after a week. I will let you know after that.
@matryer I can confirm since v2.1.0-beta I'm not seeing xbar memory usage balloon like previous versions.
Thank you for fixing this!
After 13 days of xbar (v2.1.4-beta) running with one plugin, memory usage is up to 918 MB.
This issue seems to be connected to plugins using custom icons. I tested it, using only one plugin. This plugin runs every 30 minutes and does nothing else but display a custom icon (PDF converted to Base64). Memory usage of xbar increases by around 100 MB per day. Using v2.1.6-beta.
The issue is present in text-only plugins as well, albeit perhaps at a smaller scale. I don't use custom icons and also experience increased memory use over time. Currently I've simply set a cronjob to periodically kill the process as a workaround, but obviously that's not very neat.
@leaanthony and I will dig into this in our next session, thanks for all the leads everyone.
If you can link to a gist with a plugin that reproduces this, it'd help us debug. Last time i did this, i got zero memory leaks so this will be fun
For me, the issue is reproducible with the following plugin foo.1s.sh
(all other plugins removed):
#!/usr/bin/env bash
echo "foo"
Memory use grows roughly 15MB per 10 minutes.
macOS version: 10.15.7 xbar version: v2.1.6-beta
Here you find a plugin with custom icons: https://gist.github.com/shinepixel/a282ba7245f7afa247de09765e0ab268
I did stress test with running it every 5 seconds. While this does increase memory usage, it does not make a huge difference compared to running it every 30 minutes. Somehow it is not (that) important how often the plugin is run.
When using a text-only plugin (with emojis) memory usage does increase over time, but not in a significant/bothering amount.
xbar v2.1.6-beta on macOS 11.4
for what it's worth, I'm seeing an issue where memory usage sometimes spikes suddenly to ~70-80GB. not sure if related — I'll post more if I can reproduce it more cleanly.
Same here with Latest Version of macOS. xBar over 34GB Memory.
Same here on MacOS Big Sur 11.6.2 running xbar 2.1.7-beta
and I only run 1 plugin, the UTC plugin.
It seems like there's a memory leak somewhere
Hey all 👋 We aim to look at this as a priority over the next week.
I'd like to note one thing on the side here, which is don't sweat it. You've built this application for free and are giving it away in kind. Naturally people will point it out if something's broken, but you shouldn't sweat it or be stressed about it. This is figuratively free beer, and naturally everyone will be happy if there's more free beer, but if you don't have any more free beer at one point, that's fine too — we're still grateful for all the free beer there was.
Don't listen to @Etheryte. We demand more free beer! (jk, restarting xbar once a week won't kill us 😛 )
Can someone let me know where to send the beer tho?
Hi. I was having this issue too on MacOS 10.14.6 Mojave (with a custom plugin I made using Python3). It uses custom icons too, as people were commenting (it's an alternate clock that displays emojis as an alternative to the japanese weekday). For now I solve it by forcing quit on it every now and then. Not a big problem, but it's indeed weird.
I only have 4 plugins installed and then also the memory usage is ~5 GB, would like to know how to dive deep in figuring out the issue here and resolving it.
Also, the CPU usage is pretty high too.