You are not logged in.
Hi,
I've got a problem with the kernel swap daemon [identified as kswapd0 by top]. It's just taking my 95% of my CPU, making my computer completly unresponsive, and I'm forced to force shutdown.
I think that is because I've got no swap, but I don't want to have any, because I'm afraid it destroys my SSD.
What I tried:
kill -9 58 (kills kswapd, but automatically restarts)
echo 3 > /proc/sys/vm/drop_caches (sometimes working, but I still have to write it, and sometimes it's too late).
Here is the output of uname -a:
Linux archlinux 5.1.16-arch1-1-ARCH #1 SMP PREEMPT Wed Jul 3 20:23:07 UTC 2019 x86_64 GNU/Linux
My processor is Intel(R) Celeron(R) CPU N3450 @ 1.10GHz,
and I've got 3756MiB of RAM (according to neofetch)
If you need any other information, I'll answer.
Thanks for your
Offline
Welcome to the arch linux forums MattMatt2.
Edit:
Missed you had already tried drop_caches.
Last edited by loqs (2019-07-11 21:02:34)
Offline
Most modern SSDs can take literal terabytes of writes a year and still be expected to live 10 years. If you are that strapped for resources it really is the best idea to get yourself a swap partition/file.
Last edited by V1del (2019-07-11 19:31:56)
Offline
You're running out of RAM, the system has to drop non-anonymous memory (mapped files, executables, libraries, …) and at some point you're dropping the library that's currently used so the system has to immediately re-read it, sacrificing whatever else it finds.
Get more RAM, use less RAM or add a swap partition/file (see V1del's remark - you can also use a usb key for this, but it's going to slow down and die MUCH faster).
If you do not expect to run OOM, find the offending process (on a consumer desktop it's usually the browser)
There're ways to manpulate the kernel behavior but unless you're willing to aggressively kill processes (not kswapd, but your browser) in this situation, your best option might be to increase vfs_cache_pressure (though this might be counter-productive if the OOM thrashing is caused by something loading dentry and inode caches - your drop_caches experience does however not support that scenario)
Offline
Well, thanks for your answers. I'll check vfs_cache_pressure. I've installed ArchLinux on external SSD before, and I used swap with a USB drive. That worked well.
Actually, It's Minecraft that uses so much RAM
.
But there's something I don't understand:
My computer was sold with Windows 10, and I didn't encounter any problem while starting minecraft.
Does Windows also uses swap (or any system working like that)?
Offline
Google for Swapfile.sys, Hiberfil.sys and Pagefile.sys …
Offline
Hi,
I think that is because I've got no swap, but I don't want to have any, because I'm afraid it destroys my SSD.
Not using the swap file is a very bad idea.
Are you afraid of SSD failure? Seriously.
Start using ZRam. It's used on most Android smartphones, on all Chromebooks even on the Google CloudShell (there is no swap file) that I'm currently writing.
Make use of you and you will have the same benefits. This is the fastest possible swap file, operating only in RAM.
Step 1
edit /etc/mkinitcpio.conf and zram module
MODULES=(...zram)Step 2
edit /etc/fstab
/dev/zram0 none swap defaults,pri=100 0 0Chromebook with 2G RAM using 2.8 GB zram swap.
Step 3
create file /etc/udev/rules.d/99-zram.rules
KERNEL=="zram0", ATTR{comp_algorithm}="lzo", ATTR{disksize}="3G" RUN="/usr/bin/mkswap /dev/zram0", TAG+="systemd"If these 3 steps are too difficult, you can use this option.
https://src.fedoraproject.org/fork/chri … ree/master
Offline
Limiting the number of writes on the disk (quite radical). Laptop mode.
cat /etc/sysctl.d/99-sysctl.conf
vm.dirty_expire_centisecs = 12000
vm.dirty_writeback_centisecs = 12000
vm.dirty_background_ratio = 10cat /etc/fstab
/dev/sda2 / ext4 rw,data=ordered,commit=600 0 1As a result, a minimum of 10 minutes without writing to the disk.
pidstat -dl 20
Linux 5.2.0 07/12/2019 _x86_64_ (2 CPU)
01:10:00 AM UID PID kB_rd/s kB_wr/s kB_ccwr/s iodelay Command01:10:20 AM UID PID kB_rd/s kB_wr/s kB_ccwr/s iodelay Command
[...]
[...]
01:20:00 AM UID PID kB_rd/s kB_wr/s kB_ccwr/s iodelay Command
Offline
Okay, thanks for your answers. I'll consider adding some swap to my computer (4 GB).
Offline