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 Ram usage in cosmic applications #138

Open
Thorndur opened this issue May 30, 2024 · 7 comments
Open

High Ram usage in cosmic applications #138

Thorndur opened this issue May 30, 2024 · 7 comments

Comments

@Thorndur
Copy link

Hi @lilyinstarlight,
i'm trying out Cosmic on nixos 24.11 and what i noticed is that many the Cosmic application use a lot of ram on my machine (Framework 13 amd so a x86_64 machine).
I'm not sure if that is a problem with the nix flake or with Cosmic Epoch itself.
But as other Cosmic users, don't seem to have the problem I ask here.
Specifically cosmic-comp, a bunch of applets and a few other applications all have roughly the same memory usage of ~1.4GB per process (about half of that is shared, please see screenshot of htop).
Which seems very big to me.
The applications and applets also take a while to open for the first time, which is probably related.
I have these sevices set and i'm using the cosmic cachix cache.
services.desktopManager.cosmic.enable = true;
services.displayManager.cosmic-greeter.enable = true;

Thanks for the great work on the flake, I really appreciate it!
screenshot-2024-05-30-15-59-12

@modisek
Copy link

modisek commented Jun 5, 2024

I am experiencing the same with high ram usage and also the applets being taking a long time to show output when i click o them.

@CnTeng
Copy link

CnTeng commented Jun 5, 2024

@modisek I hava the same experience with you, especially the applets.

@Itsusinn
Copy link

I cloned cosmic-term repo and build it locally (cargo run --release). The memory usage is still high(~700MB). Same as cosmic-term under this flake.
So maybe cosmic itself's problem.

@Itsusinn
Copy link

On archlinux, cosmic-term use 60MB. So maybe some logic of iced on nixos leads to this problem.

@Thorndur
Copy link
Author

Hi thanks for the hint @Itsusinn you lead me on the right track,
I think i found the cause.
Looking through the open Iced issues, i found this one iced-rs/iced#2455, where an Iced application would load all Systemfonts into memory on startup and cause performance problems through that.
I have nerdfonts installed which are pretty huge.
Removing the nerdfont package from my nix config seems to do the trick.
The Memory usage went form about 1.5 GB to about 60-100mb per app and everything is really snappy now.
So until this gets fixed on the Iced side the workaround would be to keep the fonts folder small.
screenshot-2024-06-10-15-13-54

@modisek
Copy link

modisek commented Jun 11, 2024

Thanks for that workaround @Thorndur after reducing my fonts, memory usage has gone down for everything excluding the cosmic-applets which seems to be using a lot of ram still..Other than that its now somewhat usable for me

@Itsusinn
Copy link

Itsusinn commented Jun 11, 2024

I made a pull request for cosmic-text sereval days ago, which makes parsing process quicker. At that time i didn't notice it used so much RAM. But now I think reducing fonts that need to be parsed is root of the problem.

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

4 participants