resources icon indicating copy to clipboard operation
resources copied to clipboard

High memory usage

Open gmagic opened this issue 2 years ago • 20 comments

After app start-up i see 1Gb+ of ram usage. image

gmagic avatar Oct 17 '23 10:10 gmagic

In my case at startup app uses 72MB and keep growing to 500MB and more.

  • Build: Flathub version;
  • NVIDIA drivers.

tim77 avatar Oct 17 '23 19:10 tim77

After some observations i found that seems like 1.03GB is maximum limit and after this point it stops growing. So this doesn't look like memory leak. But this to much i believe for and would be nice to reduce somehow memory consumption. Снимок экрана от 2023-10-19 16-33-38

tim77 avatar Oct 19 '23 14:10 tim77

Also happens to me. Memory usage went from around 150MB when started then Resources net.nokyan.Resources 1.1.0 stable system image

jenavarro avatar Oct 21 '23 23:10 jenavarro

Thank you all very much for the reports, I'll try to find out why that happens :)

nokyan avatar Oct 21 '23 23:10 nokyan

I have noticed higher ram usage that what've been reported here : 1.73GB of ram used by ressources image

soubiliz avatar Nov 14 '23 10:11 soubiliz

Just a quick update: I now know what seems to cause the leak and have opened a PR (#128) for it. Unfortunately I haven't yet found out how to get rid of it. I hope I'll figure something out before releasing 1.3. If someone is knowledgeable about GTK and has an idea, please don't hesitate to tell me in the PR or here. :)

nokyan avatar Dec 19 '23 16:12 nokyan

Potentially great news: I believe it's fixed now. Interestingly though, I probably fixed it on accident at some point and introduced another one with the right click context menus. In the memory-leak-fix branch I've removed the context menus again, which for me kept memory usage very much under control. I'd appreciate if someone could test it as well, I'll definitely run it over night tonight. :)

nokyan avatar Dec 21 '23 13:12 nokyan

It hasn't been fixed yet, I still see it consuming GB after being open for a while

outusuke avatar Jun 17 '24 17:06 outusuke

I've experienced increased memory consumption as well, but I frankly have not a single clue why that is.

nokyan avatar Jun 18 '24 19:06 nokyan

Almost 4GB memory consumed after cca 20 hours. Version 1.5.0 from flatpak, Ubuntu 22.04 with regolith desktop, i3wm, intel integrated gfx, two 4k displays. image

bbktsk avatar Jul 08 '24 01:07 bbktsk

I've changed some internal stuff regarding apps and processes, could you check out the appscontext-restructure branch? In my testing memory usage and leakage is reduced.

nokyan avatar Jul 28 '24 08:07 nokyan

I'm definitely getting some reduction, however that is comparing the flatpak vers to the builder vers so not certain that it will be permanent

jojo2357 avatar Aug 18 '24 16:08 jojo2357

Can you please make the flakpak for that test branch available? My rust-fu is not strong enough to build it for myself, but I'll be happy to test.

bbktsk avatar Aug 18 '24 16:08 bbktsk

Just a heads-up: the branch is merged now so you can just test main.

@jojo2357 That's good to see! To my knowledge, if anything, the Builder version should perform worse as it isn't as optimized (by the compiler) as the Flatpak production version.

@bbktsk I'll look into it but you shouldn't need any Rust to build the flatpak for yourself. In fact, it should be just three commands. :)

flatpak install org.gnome.Sdk//46 org.freedesktop.Sdk.Extension.rust-stable//23.08 org.gnome.Platform//46 org.freedesktop.Sdk.Extension.llvm18//23.08
flatpak-builder --user flatpak_app build-aux/net.nokyan.Resources.Devel.json
flatpak-builder --run flatpak_app build-aux/net.nokyan.Resources.Devel.json resources

nokyan avatar Aug 18 '24 16:08 nokyan

After 2 days on 1.6.0 im seeing 0.5GiB memory used. Progress for sure, but not solved.

jojo2357 avatar Aug 27 '24 04:08 jojo2357

After 2 days on 1.6.0 im seeing 0.5GiB memory used. Progress for sure, but not solved.

Great to see, but I agree with you, not solved yet. I'll keep experimenting, though right now I'm out of ideas of what to try to be honest.

nokyan avatar Aug 27 '24 05:08 nokyan

Over 1.5GiB used over ~10 days with 1.6.0.

JokerQyou avatar Dec 12 '24 07:12 JokerQyou

1.7.1, definitely not fixed. Also sometimes it does a crazy thing, consuming several gigs of video memory. But most of the time it's just gigs of ram. Easy to see just in one day. I have a memory view opened most of the time, and sometimes app list, sorted by ram usage. Ironically, I installed it to better manage memory usage of my system.

Image

an example of high GPU memory usage (it will go to 3-5 gigs in a short while)

Image

just 5 minutes later

0xCA avatar Feb 03 '25 06:02 0xCA

Unfortunately I can also confirm it's still not fixed. I've been seeing it grow above 13GB over several days and suspend cycles on both ubuntu 22 and 24. I can run a heap dump or something if you tell me what tooling to use for that

knackstedt avatar Feb 25 '25 13:02 knackstedt

Those of you who are still affected should try running the app under Valgrind (and GNOME Builder allows that with its "Run with leak detector" action), see https://developer.gnome.org/documentation/tools/valgrind.html

Apparently Valgrind is something that can be used in Rust according to this forum thread and that blog post, which are probably relevant guides for this situation.

nekohayo avatar Apr 01 '25 19:04 nekohayo