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

Question about considerable memory usage #105

Open
Karmak23 opened this issue Mar 20, 2023 · 2 comments
Open

Question about considerable memory usage #105

Karmak23 opened this issue Mar 20, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@Karmak23
Copy link

Karmak23 commented Mar 20, 2023

On a machine with [fixed] 4Gb of RAM, i’m looking for a balance between comfort-features and low memory usage. I landed using swww to cycle wallpapers without the gray screen of swaybg. I use swww img … with simple transition, and only fixed images (jpeg, pngs or webp).

I noticed that swww-daemon uses > 90MB of RAM even when not doing anything. I find this quite big, for just displaying a fixed image on one monitor @1920x1200px.

I understand that any animation must be precomputed and stored before beiing displayed, but could it be the daemon does not release the transitional frames after having switched to the fixed display of wallpaper ?

@LGFae
Copy link
Owner

LGFae commented Mar 24, 2023

This is a known problem, see #28 for details. We do release the frames, but there is no way of guaranteeing the OS will reclaim the memory.

I moved all of the reading the image code to the client in order to mitigate this, which seems to have cut overall memory usage by half.

I am currently planning on also moving all the animation and transition effects to the client. Then, the daemon would only have to worry about displaying images. It should reduce the memory footprint even further, but it is quite annoying to do. Also, it will require some testing to ensure we don't lose too much performance, since we will be sending a lot of information through the socket.

I thought about moving instead to a shared memory approach, which should be significantly faster, but I haven't tested it yet.

@LGFae LGFae added the enhancement New feature or request label Apr 1, 2023
@LGFae
Copy link
Owner

LGFae commented Jul 23, 2023

Hello, @Karmak23. The current master should have improved considerably in terms of memory usage. When you have the time, could you check to see if it helps you?

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

No branches or pull requests

2 participants