Hi, so I have a weird issue. I know that RAM works a little bit differently on Linux, if I understand correctly, but the issue I’m having is that I can’t figure out why is it using up almost all of my 16GB of RAM.
Specs:
Ryzen 7 5800H
2x8GB DDR4 3200MHz
nvidia-dkms 545.26.06-4
linux6.7.9-arch1-1
Plasma 6.0.2
Dual NVMe (512GB + 1TB (Linux is installed on this drive with ext4 and 16GB for swap))
Example situation:
Apps running: Firefox, Discord, VSCode
VSCode has these extensions: C/C++, poimandres (theme for VSCode), indent rainbow, Java Support, TestMyCode
Tabs running on Firefox: About 5-8.
At first, I would have like 8-9GB of RAM usage, no problem, no stutters, usable. But it gradually increases to like 13-14GB of usage and that’s when stutters start.
I keep btop and htop running on a second screen and I can’t really notice anything unusual about the running processes. But, in htop I can notice there are times when kswapd0 kicks in and that causes one of my cores almost to max out and that’s what causes a stutter. Even though, at that time, swap is only used like 10-30%. I don’t know where to really look for the issue or what’s causing it.
NVIDIA’s driver and Linux kernel are downgraded because of this - https://forums.developer.nvidia.com/t/series-550-freezes-laptop/284772. I had the same issue and the easiest way for me to solve it was to downgrade the kernel to 6.7.9 and NVIDIA driver to 545. As far as I know, 545 driver isn’t supported on 6.8 kernel, so that’s why.
Other packages were updated recently, so it’s only the kernel and NVIDIA driver that are outdated.
Here the latest nvidia and linux work OK on my desktop.
Downgrading essential packages may cause weird problems, and causes partial update situation.
So you could try now if the latest stuff works. Be sure to have the USB livesystem available.
I would upgrade, but as I said, the issue, that I posted, also affects me (had to try to recover the system one time, because of it. There was a second time it happened and I couldn’t recover the system after that, had to reinstall). It only seems to affect laptop users, which I am. I was on 550 driver and 6.8 kernel before and I had the same issue with RAM to be honest.
I was thinking about it, but still decided against it until I did more research. Especially if zram is usable for hibernation. Or should I still keep my swap partition for it, that’s what I don’t really understand.
Zram cannot be used for hibernation (aka suspend-to-disk).
You can keep your current swap partition as well.
I have both zram and a swapfile (for hibernation).
They will have different swap priority. Zram will have a much higher priority than the swap file/partition and therefore will be used first.
I got zram set up and installed LTS kernel. Just as an experiment, tried to switch to InteliJ IDEA, as at the moment I’m mostly working with Java and did the issue go away?
Not completely. It’s not as frequent, but still not great. Either I’m overestimating how much 16GB of RAM can handle or the issue goes deeper.
If any of you are wondering, I did run a memtest86+ just to be sure there are no issues with my RAM sticks for like 8 hours, no errors were returned.
zram is not suitable for hibernation. fedora is using zram and they have work arounds available for hibernation. The use a couple of extra systemd services to enable a swalfile/swap partition before hibernating and on resume they disable them and enable zram again.
Is enabling/disabling swapfil resp. zram really necessary for hibernation/resuming to work?
I do use both zram and a swapfile, the latter for hibernation, and so far I have been able to hibernate this system and resume from hibernation without any issues.
I haven’t really done anything to configure to actually, just followed the instructions you gave me from Arch wiki for zram. Hibernation worked perfectly since.