Mod-edit: Formatting and spelling
I have not used a swap the last couple of years, because I have 32GB RAM and have never even been close to maxing out my RAM.
But a few days ago I installed OpenShot
and started working on videos and when I export the videos, it uses a lot of RAM, and yesterday I had my first freeze when memory was at 31.7 GB.
My guess is that, of course, that was an out of memory-freeze.
So I tried to set up systemd-swap
by following this guide.
I got no errors while following this guide, and I don’t see any errors in journalct
after the reboot.
By using journalctl -n 1000 | grep swap I get the following result, which to me seems ok?:
dec 27 19:30:22 CURIE systemd[1]: Starting Manage swap spaces on zram, files and partitions....
dec 27 19:30:23 CURIE systemd-swap[744]: INFO: Load: /etc/systemd/swap.conf.d/myswap.conf
dec 27 19:30:23 CURIE systemd-swap[744]: INFO: Removing working directory...
dec 27 19:30:23 CURIE systemd-swap[744]: INFO: Removing files in /var/lib/systemd-swap/swapfc/...
dec 27 19:30:23 CURIE systemd-swap[744]: INFO: Load: /etc/systemd/swap.conf.d/myswap.conf
dec 27 19:30:23 CURIE systemd-swap[744]: INFO: Writing destroy info...
dec 27 19:30:23 CURIE systemd-swap[744]: INFO: swapD: pick up devices from systemd-gpt-auto-generator
dec 27 19:30:23 CURIE systemd-swap[744]: INFO: swapD: searching swap devices
dec 27 19:30:23 CURIE systemd-swap[744]: INFO: swapFC: on-demand swap activation at >20874 MiB memory usage
dec 27 19:30:23 CURIE audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 subj==unconfined msg='unit=systemd-swap comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
dec 27 19:30:23 CURIE systemd[1]: Started Manage swap spaces on zram, files and partitions..
Still swapon -s gives me no result, but if I interpret the wiki correctly I should see something similar to this:
NAME TYPE SIZE USED PRIO
/var/lib/systemd-swap/swapfc/1 file 512M 0B -2
Can I assume that it is working, even though swapon
gives no result?
Has systemd-swap
just chosen to not use a swap file for now?
Will the swap file be created when I start exporting in OpenShot again?
A not so important follow up question:
- Will a swap eventually stop the applications from asking for more memory (or rather, will the kernel eventually tell the applications “no, you can’t have more memory, I’m out”)?
Otherwise I don’t see why I wouldn’t get a new freeze at 64GB used RAM (if I in this example had 32GB swap), or that the swap file would eventually fill the entire hard drive (when using an automatically handled swap file, likesystemd-swap
)?
Inxi
Inxi -Fayz
System:
Kernel: 5.4.80-2-MANJARO x86_64 bits: 64 compiler: gcc v: 10.2.0
parameters: BOOT_IMAGE=/boot/vmlinuz-5.4-x86_64
root=UUID=5f0455e6-c280-495c-a6fb-976924a79721 rw quiet apparmor=1
security=apparmor udev.log_priority=3
Desktop: Cinnamon 4.8.0 tk: GTK 3.24.23 dm: LightDM 1.30.0
Distro: Manjaro Linux
Machine:
Type: Desktop System: Inet_AB product: N/A v: N/A serial: <filter>
Mobo: ASUSTeK model: PRIME B450M-A v: Rev X.0x serial: <filter>
UEFI: American Megatrends v: 2006 date: 11/13/2019
CPU:
Info: 6-Core model: AMD Ryzen 5 3600 bits: 64 type: MT MCP arch: Zen 2
family: 17 (23) model-id: 71 (113) stepping: N/A microcode: 8701013
L2 cache: 3072 KiB
flags: avx avx2 lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm
bogomips: 86277
Speed: 2697 MHz min/max: 2200/3600 MHz boost: enabled Core speeds (MHz):
1: 2697 2: 3050 3: 2391 4: 2220 5: 2092 6: 2327 7: 2294 8: 2191 9: 3249
10: 2015 11: 2097 12: 3577
Vulnerabilities: Type: itlb_multihit status: Not affected
Type: l1tf status: Not affected
Type: mds status: Not affected
Type: meltdown status: Not affected
Type: spec_store_bypass
mitigation: Speculative Store Bypass disabled via prctl and seccomp
Type: spectre_v1
mitigation: usercopy/swapgs barriers and __user pointer sanitization
Type: spectre_v2 mitigation: Full AMD retpoline, IBPB: conditional, STIBP:
conditional, RSB filling
Type: srbds status: Not affected
Type: tsx_async_abort status: Not affected
Graphics:
Device-1: AMD Ellesmere [Radeon RX 470/480/570/570X/580/580X/590]
vendor: Sapphire Limited Nitro+ driver: amdgpu v: kernel bus ID: 08:00.0
chip ID: 1002:67df
Display: x11 server: X.Org 1.20.10 driver: amdgpu,ati unloaded: modesetting
alternate: fbdev,vesa display ID: :0 screens: 1
Screen-1: 0 s-res: 5760x1080 s-dpi: 96 s-size: 1524x285mm (60.0x11.2")
s-diag: 1550mm (61")
Monitor-1: DisplayPort-0 res: 1920x1080 hz: 60 dpi: 82
size: 598x336mm (23.5x13.2") diag: 686mm (27")
Monitor-2: DisplayPort-1 res: 1920x1080 hz: 60 dpi: 82
size: 598x336mm (23.5x13.2") diag: 686mm (27")
Monitor-3: DVI-D-0 res: 1920x1080 hz: 60 dpi: 82
size: 598x336mm (23.5x13.2") diag: 686mm (27")
OpenGL: renderer: Radeon RX 580 Series (POLARIS10 DRM 3.35.0
5.4.80-2-MANJARO LLVM 11.0.0)
v: 4.6 Mesa 20.2.3 direct render: Yes
Audio:
Device-1: AMD Ellesmere HDMI Audio [Radeon RX 470/480 / 570/580/590]
vendor: Sapphire Limited driver: snd_hda_intel v: kernel bus ID: 08:00.1
chip ID: 1002:aaf0
Device-2: AMD Starship/Matisse HD Audio vendor: ASUSTeK
driver: snd_hda_intel v: kernel bus ID: 0a:00.4 chip ID: 1022:1487
Device-3: Logitech Logitech BRIO type: USB
driver: hid-generic,snd-usb-audio,usbhid,uvcvideo bus ID: 4-4:2
chip ID: 046d:085e serial: <filter>
Sound Server: ALSA v: k5.4.80-2-MANJARO
Network:
Device-1: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet
vendor: ASUSTeK driver: r8169 v: kernel port: f000 bus ID: 07:00.0
chip ID: 10ec:8168
IF: enp7s0 state: up speed: 1000 Mbps duplex: full mac: <filter>
IF-ID-1: tun0 state: unknown speed: 10 Mbps duplex: full mac: N/A
Drives:
Local Storage: total: 3.40 TiB used: 1.39 TiB (40.8%)
SMART Message: Required tool smartctl not installed. Check --recommends
ID-1: /dev/sda vendor: Toshiba model: TR200 size: 223.57 GiB block size:
physical: 512 B logical: 512 B speed: 6.0 Gb/s serial: <filter> rev: 15.3
scheme: MBR
ID-2: /dev/sdb vendor: Western Digital model: WD20EZRZ-00Z5HB0
size: 1.82 TiB block size: physical: 4096 B logical: 512 B speed: 6.0 Gb/s
rotation: 5400 rpm serial: <filter> rev: 0A80 scheme: GPT
ID-3: /dev/sdc vendor: Samsung model: SSD 850 EVO 500GB size: 465.76 GiB
block size: physical: 512 B logical: 512 B speed: 6.0 Gb/s serial: <filter>
rev: 1B6Q scheme: GPT
ID-4: /dev/sdd vendor: Samsung model: SSD 850 EVO 1TB size: 931.51 GiB
block size: physical: 512 B logical: 512 B speed: 6.0 Gb/s serial: <filter>
rev: 3B6Q scheme: GPT
Partition:
ID-1: / raw size: 931.22 GiB size: 915.60 GiB (98.32%)
used: 243.92 GiB (26.6%) fs: ext4 dev: /dev/sdd2
Swap:
Alert: No Swap data was found.
Sensors:
System Temperatures: cpu: 48.0 C mobo: N/A gpu: amdgpu temp: 37.0 C
Fan Speeds (RPM): N/A gpu: amdgpu fan: 828
Info:
Processes: 351 Uptime: 12h 36m Memory: 31.36 GiB used: 4.17 GiB (13.3%)
Init: systemd v: 246 Compilers: gcc: 10.2.0 clang: 11.0.0 Packages: 1286
pacman: 1270 lib: 355 flatpak: 8 snap: 8 Shell: Bash v: 5.0.18
running in: gnome-terminal inxi: 3.1.08