How to improve RAM usage/management?

Hi there,

I’ve noticed that on both Aurora and Bluefin my system starts to freeze for several minutes as soon as my RAM (16GB DDR5 on a gaming laptop) starts to become full.

This simply cannot work for me as it’s not reliable. I’d be OK with a mega-slow system or a sluggish one as I could still operate and close apps, but I can’t really accept a system that freezes for 10 minutes.

Should I move to a normal swap system? zswap? Change any settings under the hood?

1 Like

Could you show how swapping is setup currently? Then could you please show something like

free -t -h

I’m having similar issues. I think it’s related to the apportioned ram that my integrated GPU has access to. Mission center shows my ram 32gb as being fine but my gpu ram is maxed out and that’s when it freezes. But I have an integrated ryzen cpu.

It’s set as Aurora’s default

free -t -h
total used free shared buff/cache available
Mem: 15Gi 7,3Gi 884Mi 1,6Gi 9,2Gi 8,1Gi
Swap: 8,0Gi 56Ki 8,0Gi
Total: 23Gi 7,3Gi 8,9Gi

1 Like

This doesn’t look like a memory problem. I would assume the cause for a freeze is something different.

For now, I’ve resolved by adding more memory to zram (beside switching the compression alg to zstd). Probably something was using too much memory (but still, I don’t like how it’s handled on Linux as I prefer a more decisive action from the OS in order to avoid any freeze)

Could you explain (even if briefly) how you increased swap and changed to zstd?

Although I use Bazzite, I’m going to re-post some things regarding ram and KDE from one of my earlier posts, hopefully it shaves off a gig or two for you:

Things I recommend:

-If you open Bazaar and close it…it will still run in memory…make sure to quit the application in system monitor (note that next time it starts it will need the same amount of time to startup as the first…not a big deal really)

I’m still holding out hope that the flatpak version of bazaar will be added to Bazzite so this problem will go away.

-Next: search through KDE ‘background services’ and stop + disable unneeded services.

-If you don’t use the web search from the the start menu (plasma search and/or Krunner) and instead use a dedicated web browser, consider disabling the ‘web search keywords’ options…reduce other search options that are not needed for local queries…this will cut down on the things KDE needs to pull up each and every search query - this will save resources.

-Always Quit Xwayland Video bridge on startup in the status and notifications section -click the ‘up arrow’ in the right hand corner of the taskbar by time/date and right click Xwayland Video Bridge and click ‘quit’. Yes there are some ways to disable this, see here:

-If you don’t need a custom desktop wallpaper…use the standard static ones…believe it or not this too may increase ram usage…part of the problem I believe is the way the data is accessed. I can’t say for sure…but it may be because the wallpapers setting section is pulling stuff from different directories.

-Make sure your desktop theme is all the same across the board and preferably a standard option…if some parts are different from each other this may lead to higher memory consumption…so if it is ‘vapor’ choose to apply it to all in settings…also Breeze/Breeze Dark/fedora use a bit less memory than vapor….but this probably not a huge change…feel free to experiment. (Note that this may rearrange or remove taskbar icons/add or remove widgets/etc. to defaults… make sure to keep a note of how you had everything before…it is also best to close all open applications before making this change. Don’t worry you can change your taskbar icons back….and still have the ram benefit…now lets talk widgets.

-Right click the taskbar to show ‘add or manage’ widget options then in the right top corner select ‘running’ to show all currently running widgets. Try to use the minimum number of widgets… for instance if you don’t use virtual desktops- remove pager, you can remove the separator that sits between the time and the system tray, and the peek at desktop option.

-In flatseal/kde permissions reduce the number of apps that use internet connections or mangohud…unless needed….

-Set time to manual as opposed to automatic…otherwise chronyd will keep sending time sync connections out every 2- 5 minutes… that default might be great for servers where you are dealing with massive amounts of data where data packet loss or corruption could be a problem if time is not really well synced…or you have high precision instruments in lab somewhere that need this precise time keeping…but this is really unnecessary in most scenarios for an everyday desktop environment.

-Unless otherwise needed set firewall zone to ‘public’ for your connection in the network manager (wifi- internet settings) under the general tab.

-Also set the connection to metered.

-You may also wish to change the default ‘connect with priority’ option if internet feels slow to ‘0’ from the negative numbers.

To put it into context at startup before opening too much stuff ram usage is only at 3.1-3.6 GB at idle.

1 Like

sudo nano /etc/systemd/zram-generator.conf

Then I’ve put

[zram0]
zram-fraction=0.75
max-zram-size=12288
compression-algorithm=zstd

max ram size is the value that will let you change the amount of swap/zram/whatever it is.

I’ve also reboot’d the system just to be sure.

I can double check and verify this with the system monitor

2 Likes

Bluefin has too many GNOME extensions pre-installed for my taste so I disable them all, which probably helps with system resources, too

If this was an out-of-memory situation, the OOM killer would have stepped in to terminate processes, but I’m guessing this isn’t aware of GPU memory

1 Like