Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

High Memory usage issue #725

Open
DefCon-007 opened this issue May 25, 2021 · 28 comments
Open

High Memory usage issue #725

DefCon-007 opened this issue May 25, 2021 · 28 comments

Comments

@DefCon-007
Copy link

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.
Screenshot 2021-05-26 at 12 52 29 AM

Also, the CPU usage is pretty high too.
Screenshot 2021-05-26 at 12 55 28 AM

@leaanthony
Copy link
Collaborator

Is this true regardless of which plugins you use or can it be isolated to a particular plugin?

@DefCon-007
Copy link
Author

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.

@pdondl
Copy link

pdondl commented May 31, 2021

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.

@leaanthony
Copy link
Collaborator

Is it sometimes or always? 😄

@pdondl
Copy link

pdondl commented May 31, 2021

Memory footprint seems to be continuously growing. 4 hours ago it was ~50Mb, now it's ~90Mb (all according to Activity Monitor).

@DamiansDesign
Copy link

I'm also seeing high memory usage. With one plugin installed, after a few days xbar is over 1.2GB of memory usage.

@Etheryte
Copy link

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 #731, the underlying problem should be the same.

@DefCon-007
Copy link
Author

@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.

@leaanthony
Copy link
Collaborator

I'll be addressing this over the next week. Thanks for your patience 👍

@leaanthony
Copy link
Collaborator

This is fixed by #731

@matryer
Copy link
Owner

matryer commented Jul 14, 2021

@DefCon-007 Any chance you can confirm this?

@DefCon-007
Copy link
Author

@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.

@DamiansDesign
Copy link

@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!

@DamiansDesign
Copy link

DamiansDesign commented Jul 28, 2021

After 13 days of xbar (v2.1.4-beta) running with one plugin, memory usage is up to 918 MB.

@shinepixel
Copy link

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.

@Etheryte
Copy link

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.

@matryer
Copy link
Owner

matryer commented Sep 18, 2021

@leaanthony and I will dig into this in our next session, thanks for all the leads everyone.

@leaanthony
Copy link
Collaborator

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

@Etheryte
Copy link

Etheryte commented Sep 18, 2021

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

@shinepixel
Copy link

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

@samsamoa
Copy link

samsamoa commented Nov 22, 2021

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.
image

@MrDrache333
Copy link

Same here with Latest Version of macOS. xBar over 34GB Memory.

@booi
Copy link

booi commented Apr 11, 2022

Same here on MacOS Big Sur 11.6.2 running xbar 2.1.7-beta and I only run 1 plugin, the UTC plugin.

image

It seems like there's a memory leak somewhere

image

@leaanthony
Copy link
Collaborator

Hey all 👋 We aim to look at this as a priority over the next week.

@Etheryte
Copy link

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.

@stavfx
Copy link

stavfx commented Apr 12, 2022

Don't listen to @Etheryte. We demand more free beer!
(jk, restarting xbar once a week won't kill us 😛 )

@booi
Copy link

booi commented Apr 12, 2022

Can someone let me know where to send the beer tho?

@Rusca8
Copy link

Rusca8 commented Apr 20, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests