DankMaterialShell icon indicating copy to clipboard operation
DankMaterialShell copied to clipboard

qs is using 24% of my ram

Open Snowy-Fluffy opened this issue 1 year ago • 15 comments

Compositor

  • Hyprland

Arch 6.17.2-zen1-1-zen

dms-shell-git 0.1.15.r8.g7e94124-1

Description

quick shell is using 24%~ of my RAM (7.6gb~), i think this is not normal

Image

Steps to Reproduce

just normal dms using

(I can restart dms, but its still not fine)

Snowy-Fluffy avatar Oct 18 '25 23:10 Snowy-Fluffy

There is like 20+ instances running idk how that's possible, pkill qs and restart it maybe. Perhaps something went wrong with child process tracking during restarts

bbedward avatar Oct 19 '25 00:10 bbedward

There is like 20+ instances running idk how that's possible, pkill qs and restart it maybe. Perhaps something went wrong with child process tracking during restarts

Image

I restarted the session yesterday, now its happening again, only this time its using 2.6 gb

Snowy-Fluffy avatar Oct 19 '25 11:10 Snowy-Fluffy

how do you start qms normally? hyprland or niri config or systemd?

The probem is quickshell processes being spawned numerous times

bbedward avatar Oct 19 '25 16:10 bbedward

how do you start qms normally? hyprland or niri config or systemd?

The probem is quickshell processes being spawned numerous times

arch linux (on systemd of course), im using hyprland. I normally start dms manually by writing the command dms in tty and select start, then start hyprland with the command hyprland. Now i have 28 threads of qs

Image

Snowy-Fluffy avatar Oct 19 '25 17:10 Snowy-Fluffy

I'm not sure whats up with it, but I wouldnt expect to be able to start dms before hyprland. That might be the problem? I'm not exactly able to reproduce it.

The flow really should be, in hyprland config if you want it at startup:

exec-once = dms run

if you don't want it at startup, just run dms run -d in a terminal.

bbedward avatar Oct 20 '25 02:10 bbedward

I still have a lot of threads

Snowy-Fluffy avatar Oct 21 '25 18:10 Snowy-Fluffy

I can't re-create the scenario of multiple quickshell threads going, though I'd like to understand what's creating them.

I don't know how it's possible really without seeing like 50 bars on your screen.

I would verify you dont have some systemd unit misbehaving, make sure dms version reports v0.1.17 or newer. (Though like I said if you have 30 quickshells I'd expect to see like, 30 bars on your screen instead of just 1)

With a dms run there would be 1 quickshell child process, dms kill would kill dms and its children process.

bbedward avatar Oct 21 '25 21:10 bbedward

I can't re-create the scenario of multiple quickshell threads going, though I'd like to understand what's creating them.

I don't know how it's possible really without seeing like 50 bars on your screen.

I would verify you dont have some systemd unit misbehaving, make sure dms version reports v0.1.17 or newer. (Though like I said if you have 30 quickshells I'd expect to see like, 30 bars on your screen instead of just 1)

With a dms run there would be 1 quickshell child process, dms kill would kill dms and its children process.

dms shell version: dms-shell 0.1.17-1

this happening when im trying to restart dms

-> dms restart
  INFO  go: Killed DMS process with PID 1625
  INFO  go: Killed DMS process with PID 1498
  INFO  go: DMS shell daemon started (PID: 534848)

But, I dont have multiple children or process, I have exactly multiple threads (like 15 or 30), and I think its okay when a process has multiple threads

But the problem with high memory usage still exists, qs can use both 700mb and 5gb of my RAM

Snowy-Fluffy avatar Oct 22 '25 05:10 Snowy-Fluffy

qs with DMS takes ~3GB after 19 hours of operation:

Image
$ ps -p 1541 -o pid,comm,etime,etimes,lstart
    PID COMMAND             ELAPSED ELAPSED                  STARTED
   1541 qs               1-19:57:59  158279 Mon Oct 20 15:25:45 2025

after reload, RAM usage drops to 800-900MB:

Image

I use hyprland and there is nothing unusual in /var/run/user//quickshell/by-id//log.log. In hyprland logs I see a lot of hyprctl calls (~ 10 per seccond) with arguments -j devices:

[LOG] Hyprctl: new connection from pid 1541
[LOG] Hyprctl: new connection from pid 1541
[LOG] Hyprctl: new connection from pid 1541
[LOG] Hyprctl: new connection from pid 1541
[LOG] Hyprctl: new connection from pid 1541
[LOG] Hyprctl: new connection from pid 1541

But I am not sure if it is related.

chpock avatar Oct 22 '25 08:10 chpock

is there any update on this? i can also help if you can guide me how to, tried to profile memory allocations with valgrind, but got a bit confusing for me since i haven't done this

basically same as above issues, over 7 hours process will go from 700mb to around 3 gb, and i saw it reach 7gb i just do dms kill && dms run manually (can set a timer) as a temporary workaround in the meanwhile

NoorHajDawood avatar Oct 28 '25 23:10 NoorHajDawood

Have you updated dms recently? I can't reproduce any memory problem but I did fix an issue that caused a crash on hyprland at some point along the way - related to hyprland toplevel bindings.

bbedward avatar Oct 29 '25 00:10 bbedward

yeah i update frequently, happy to help you anyway i can to pinpoint the issue

NoorHajDawood avatar Oct 29 '25 06:10 NoorHajDawood

A couple things stand out:

  • [LOG] Hyprctl: new connection from pid 1541

Probably related to the keyboard layout widget - which was polling every 1 second: 2a7cf187ad165fd2bdb78f5e0888355e7f1a93cd , doubt it caused any issues but I removed it anyway since it feels wasteful.

  • Seeing gdbus monitor.. indicates that dms was started with quickshell directly, not dms run which is fine, it just strips some features. I neutered the legacy hacky network service to not create such monitors though 0569906f7c856c7b8a2e912cce0d4a1e8f0f3dbe

I don't think either of those are the causes though (could be wrong). I wonder if this is a problem within quickshell itself

bbedward avatar Oct 29 '25 21:10 bbedward

Another one 7ed0b752a807d39eab1242c0e0f8f8e636b19f89 that I also dont think would be related.

I can't reproduce the exponential memory growth thing (on niri or Hyprland) but I'll keep an eye on it.

bbedward avatar Oct 29 '25 21:10 bbedward

Last update seems to have fixed the issue for me

NoorHajDawood avatar Oct 31 '25 00:10 NoorHajDawood