Should I add a swap file? And how?

Hello,

I am contemplating if I should add a swap file, as I don’t have much knowledge on it, when installing endeavouros I opted out for the swap partition, and went with no swap for the first time. The issue is that lately my ram is getting too high while i have chrome, vscode and docker running that sometimes the apps close by themselves because of full memory to liberate space, and sometimes even forced to log out.

Also I would like to ask another thing I read, should I left 10% un-formatted space at the end of the drive, I read it from First Laptop Installation - #3 by ricklinux, but its from Dec 2020. Though I also read that in modern ssd is not necessary.

System:
Kernel: 6.10.10-arch1-1 arch: x86_64 bits: 64 compiler: gcc v: 14.2.1
Desktop: GNOME v: 47.0 Distro: EndeavourOS base: Arch Linux
Machine:
Type: Laptop System: HP product: OMEN Laptop 15-en1xxx v: N/A
serial:
Mobo: HP model: 88D1 v: 75.75 serial: UEFI: AMI v: F.20
date: 08/09/2022
Battery:
ID-1: BAT0 charge: 49.5 Wh (91.0%) condition: 54.4/54.4 Wh (100.0%)
volts: 12.9 min: 11.6 model: HP Primary status: charging
CPU:
Info: 6-core model: AMD Ryzen 5 5600H with Radeon Graphics bits: 64
type: MT MCP arch: Zen 3 rev: 0 cache: L1: 384 KiB L2: 3 MiB L3: 16 MiB
Speed (MHz): avg: 3250 min/max: 400/4280 cores: 1: 3250 2: 3250 3: 3250
4: 3250 5: 3250 6: 3250 7: 3250 8: 3250 9: 3250 10: 3250 11: 3250 12: 3250
bogomips: 79082
Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm
Graphics:
Device-1: NVIDIA GA106M [GeForce RTX 3060 Mobile / Max-Q]
vendor: Hewlett-Packard driver: nvidia v: 560.35.03 arch: Ampere
bus-ID: 01:00.0
Device-2: Advanced Micro Devices [AMD/ATI] Cezanne [Radeon Vega Series /
Radeon Mobile Series] vendor: Hewlett-Packard driver: amdgpu v: kernel
arch: GCN-5 bus-ID: 07:00.0 temp: 56.0 C
Device-3: Quanta HP Wide Vision HD Camera driver: uvcvideo type: USB
bus-ID: 1-3:2
Display: unspecified server: X.Org v: 21.1.13 with: Xwayland v: 24.1.2
driver: X: loaded: amdgpu,nvidia unloaded: modesetting,radeon dri: radeonsi
gpu: amdgpu,nvidia,nvidia-nvswitch resolution: 1: 2560x1440
2: 1920x1080~144Hz
API: EGL v: 1.5 drivers: nvidia,radeonsi,swrast platforms:
active: gbm,x11,surfaceless,device inactive: wayland,device-1
API: OpenGL v: 4.6.0 compat-v: 4.5 vendor: amd mesa v: 24.2.3-arch1.1
glx-v: 1.4 direct-render: yes renderer: AMD Radeon Graphics (radeonsi
renoir LLVM 18.1.8 DRM 3.57 6.10.10-arch1-1)
Drives:
Local Storage: total: 942.7 GiB used: 24.74 GiB (2.6%)
ID-1: /dev/nvme0n1 vendor: Western Digital model: WD Blue SN570 500GB
size: 465.76 GiB temp: 39.9 C
Partition:
ID-1: / size: 456.39 GiB used: 24.45 GiB (5.4%) fs: ext4 dev: /dev/nvme0n1p2
Swap:
Alert: No swap data was found.
Sensors:
System Temperatures: cpu: 81.2 C mobo: N/A gpu: amdgpu temp: 55.0 C
Fan Speeds (rpm): fan-1: 3089 fan-2: 2702
Info:
Memory: total: 16 GiB note: est. available: 14.97 GiB used: 8.85 GiB (59.1%)
Processes: 395 Uptime: 2h 10m Init: systemd
Packages: 898 Compilers: gcc: 14.2.1 Shell: Sudo v: 1.9.16 inxi: 3.3.36

You might have a look at this article @GerLC :point_down:

EndeavourOS Discovery - Adding swap after installation

3 Likes