Do i need swap?

What I do is using a swap file, and let it scale as needed.

1 Like

I am still new in this. And now I am confused…what is the best solution than ?

To make swap partition during the installation or what ?

Use systemd-swap It’ll take care of itself as said on #4

1 Like

There is rarely such a thing as the best solution. It always depends on what you want to do, then some solution can be helpful to achieve your goal. The same solution can become a hinderance in other cases.

1 Like

Interesting. I have 32 GB as well, with a 500 MB swap file. I do see some swap use from time to time in a ballpark of tens of megabytes, with swappiness set to 20. And I haven’t used the system for anything memory intensive since I installed Manjaro about three months ago :thinking:

Personally, I think swap needed when compiling from AUR or from source code.

https://pasteboard.co/Jnp5rUf.jpg

1 Like

Nothing special… I have 6 gb ram which is shared with graphics card…I just want smooth multitasking, browsing and gaming (only fm20). Most of the time while I am using chrome, few tabs opened, laptop slows

Can I use swap partition and systemd-swap together ?

To quote from the arch wiki link given earlier in this thread:

In order for systemd_swap to be effective you need to remove any traditional swap devices you have.

2 Likes

Oh thanks, I missed that…so to be sure, while installation, for swap partition I need to choose none ? And when installation is finished, only use systemd-swap ? Thanks

Hi, I just installed fresh KDE on my laptop.

I wanted to try setup systemd-swap but I stucked on step : creating a file /etc/systemd/swap.conf.d/myswap.conf

How to do that ? In Dolphin I can not open etc folder as root ?thx

It’s all described in the wiki:

sudo bash -c 'echo -e "zswap_enabled=0\nzram_enabled=0\nswapfc_enabled=1" > /etc/systemd/swap.conf.d/myswap.conf'

https://wiki.manjaro.org/index.php?title=Swap

2 Likes

Yes, I tried that and got this :slight_smile:
[marko@marko-hpenvy ~]$ sudo bash -c ‘echo -e “zswap_enabled=0\nzram_enabled=0\nswapfc_enabled=1” > /etc/systemd/swap.conf.d/myswap.conf’
[sudo] password for marko:
bash: /etc/systemd/swap.conf.d/myswap.conf: No such file or directory

Try

echo -e "zswap_enabled=0\nzram_enabled=0\nswapfc_enabled=1" | sudo tee /etc/systemd/swap.conf.d/myswap.conf

If this is also not working you first need to create the missing directory /etc/systemd/swap.conf.d.

1 Like

Yeah, I figured that… But In dolphin can not because no root in folder. In xfce I used option Thunar root. How to do that in Dolphin (KDE) ?

Use a terminal window and enter

cd /etc/systemd
sudo mkdir swap.conf.d
1 Like

Thanks… got it now :slight_smile: how to check if it is working ?
I tried to use command swapon, but nothing showed

Use

systemctl status systemd-swap.service
1 Like

Watching this , I will say it is working :slight_smile: `

[marko@marko-hpenvy ~]$ systemctl status systemd-swap.service
● systemd-swap.service - Manage swap spaces on zram, files and partitions.
Loaded: loaded (/usr/lib/systemd/system/systemd-swap.service; enabled;>
Active: active (running) since Sat 2020-08-29 22:27:27 CEST; 31min ago
Main PID: 482 (systemd-swap)
Status: “Monitoring memory status…”
Tasks: 1 (limit: 6958)
Memory: 15.8M
CGroup: /system.slice/systemd-swap.service
└─482 /usr/bin/python3 -u /usr/bin/systemd-swap start

kol 29 22:27:26 marko-hpenvy systemd[1]: Starting Manage swap spaces on zra>
kol 29 22:27:27 marko-hpenvy systemd-swap[482]: INFO: Load: /etc/systemd/sw>
kol 29 22:27:27 marko-hpenvy systemd-swap[482]: INFO: Removing working dire>
kol 29 22:27:27 marko-hpenvy systemd-swap[482]: INFO: Removing files in /va>
kol 29 22:27:27 marko-hpenvy systemd-swap[482]: INFO: Load: /etc/systemd/sw>
kol 29 22:27:27 marko-hpenvy systemd-swap[482]: INFO: Writing destroy info.>
kol 29 22:27:27 marko-hpenvy systemd-swap[482]: INFO: swapD: pick up device>
kol 29 22:27:27 marko-hpenvy systemd-swap[482]: INFO: swapD: searching swap>
kol 29 22:27:27 marko-hpenvy systemd-swap[482]: INFO: swapFC: on-demand swa>
kol 29 22:27:27 marko-hpenvy systemd[1]: Started Manage swap spaces on zram>
lines 1-20/20 (END)…skipping…
● systemd-swap.service - Manage swap spaces on zram, files and partitions.
Loaded: loaded (/usr/lib/systemd/system/systemd-swap.service; enabled; vendor preset: disabled)
Active: active (running) since Sat 2020-08-29 22:27:27 CEST; 31min ago
Main PID: 482 (systemd-swap)
Status: “Monitoring memory status…”
Tasks: 1 (limit: 6958)
Memory: 15.8M
CGroup: /system.slice/systemd-swap.service
└─482 /usr/bin/python3 -u /usr/bin/systemd-swap start

kol 29 22:27:26 marko-hpenvy systemd[1]: Starting Manage swap spaces on zram, files and partitions…
kol 29 22:27:27 marko-hpenvy systemd-swap[482]: INFO: Load: /etc/systemd/swap.conf.d/myswap.conf
kol 29 22:27:27 marko-hpenvy systemd-swap[482]: INFO: Removing working directory…
kol 29 22:27:27 marko-hpenvy systemd-swap[482]: INFO: Removing files in /var/lib/systemd-swap/swapfc/…
kol 29 22:27:27 marko-hpenvy systemd-swap[482]: INFO: Load: /etc/systemd/swap.conf.d/myswap.conf
kol 29 22:27:27 marko-hpenvy systemd-swap[482]: INFO: Writing destroy info…
kol 29 22:27:27 marko-hpenvy systemd-swap[482]: INFO: swapD: pick up devices from systemd-gpt-auto-generator
kol 29 22:27:27 marko-hpenvy systemd-swap[482]: INFO: swapD: searching swap devices
kol 29 22:27:27 marko-hpenvy systemd-swap[482]: INFO: swapFC: on-demand swap activation at >3822 MiB memory usage
kol 29 22:27:27 marko-hpenvy systemd[1]: Started Manage swap spaces on zram, files and partitions.`

I searched but didn’t find a right answer… what is difference between systems swap and swap file ? Ok both don’t need partition.