Swap: Difference between revisions

m minor edit
m minor edit #2
Line 62: Line 62:
[https://github.com/Tookmund/Swapspace Swapspace] is a dynamic swap space manager for GNU/Linux. i.e. it allows unused disk space to be utilised as swap to handle the occasional memory-intensive task, and frees the disk space once done.
[https://github.com/Tookmund/Swapspace Swapspace] is a dynamic swap space manager for GNU/Linux. i.e. it allows unused disk space to be utilised as swap to handle the occasional memory-intensive task, and frees the disk space once done.


Enable it via <code>services.swapspace.enable = true;</code> in your nixos configuration.
Enable it via <code>services.swapspace.enable = true;</code> in your nixos configuration. Check that <code>systemctl status swapspace.service</code> is green, it will auto manage swap for you.
 
Check that <code>systemctl status swapspace.service</code> is green, it will auto manage swap for you.


See all the options it supports here, [https://search.nixos.org/options?query=swapspace search.nixos.org]
See all the options it supports here, [https://search.nixos.org/options?query=swapspace search.nixos.org]


Can use zramSwap along with this service.
Can also use zramSwap along with this service.
 
See your active swap partitions/files with `swapon`. For eg.
See your active swap partitions/files with `swapon`. For eg.
{{warning|Do not run the following without swapspace active + 40GB free disk space OR if you have 40GB ram to spare.}}
{{warning|Do not run the following without swapspace active + 40GB free disk space OR if you have 40GB ram to spare.}}
<syntaxhighlight lang="console">
<syntaxhighlight lang="console">
# Read the WARNING above, or adjust 2, 20GB according to your free space
# Read the WARNING above, or adjust 2, 20GB according to your free space