How to Add swap space
How to Add swap space
I see people all the time with no swap file or swap space, and many dont understand a) that even a little swap space is VERY good for your system, and b) how to create swap once your up and installed.
The reality of the first part is that some swap space is required for some applications to properly run. Even if you have gobs of ram, the reality that some applications need 'a little swap space' , or will just check for it before they start, or will even allocate a little swap space just in case.
Many times the creation of a small swap space will resolve "odd issues" that are hard to pin down, and creation of a swap file even can help test / resolve some issues.
So, how can you easily check and create swap ? ... This is the best guide I have found and covers checking, turning on and off and creation of both types of swap.
https://www.digitalocean.com/community/ ... -debian-11
The reality of the first part is that some swap space is required for some applications to properly run. Even if you have gobs of ram, the reality that some applications need 'a little swap space' , or will just check for it before they start, or will even allocate a little swap space just in case.
Many times the creation of a small swap space will resolve "odd issues" that are hard to pin down, and creation of a swap file even can help test / resolve some issues.
So, how can you easily check and create swap ? ... This is the best guide I have found and covers checking, turning on and off and creation of both types of swap.
https://www.digitalocean.com/community/ ... -debian-11
*QSI = Quick System Info from menu (Copy for Forum)
*MXPI = MX Package Installer
*Please check the solved checkbox on the post that solved it.
*Linux -This is the way!
*MXPI = MX Package Installer
*Please check the solved checkbox on the post that solved it.
*Linux -This is the way!
Re: How to Add swap space
@CharlesV Thanks for the link and article, I get these as pdf's incase I lose my own memory in future days passed.
" Outside the square , inside the cube "
Re: How to Add swap space
Your very welcome! and yes, I have both links and PDF's of too :-)
*QSI = Quick System Info from menu (Copy for Forum)
*MXPI = MX Package Installer
*Please check the solved checkbox on the post that solved it.
*Linux -This is the way!
*MXPI = MX Package Installer
*Please check the solved checkbox on the post that solved it.
*Linux -This is the way!
Re: How to Add swap space
ZRam and Zswap
zram (previously called compcache) can create RAM based compressed block devices. It is a module of the Linux kernel since 3.2.
If physical swap devices exist, they will also be used by the system, but with a lower priority than a Zram device.
Similar results as with Zram can be achieved with Zswap, though Zswap needs a physical swap device (or swap file).
Zswap
Zswap is a lightweight compressed cache for swap pages. It takes pages that are in the process of being swapped out and attempts to compress them into a dynamically allocated RAM-based memory pool. Older pages can be evicted to disk making this a sort of write-behind cache. zswap basically trades CPU cycles for potentially reduced swap I/O.
Alternative
Similar results as with Zswap can be achieved with Zram though eliminates the need for physical swap device.
https://wiki.debian.org/ZRam
zram (previously called compcache) can create RAM based compressed block devices. It is a module of the Linux kernel since 3.2.
If physical swap devices exist, they will also be used by the system, but with a lower priority than a Zram device.
Similar results as with Zram can be achieved with Zswap, though Zswap needs a physical swap device (or swap file).
Zswap
Zswap is a lightweight compressed cache for swap pages. It takes pages that are in the process of being swapped out and attempts to compress them into a dynamically allocated RAM-based memory pool. Older pages can be evicted to disk making this a sort of write-behind cache. zswap basically trades CPU cycles for potentially reduced swap I/O.
Alternative
Similar results as with Zswap can be achieved with Zram though eliminates the need for physical swap device.
https://wiki.debian.org/ZRam
Re: How to Add swap space
How to Add ZRam and Zswap with antiX memory manager GUI
antiX memory manager is a Control centre script allowing for checking and managing the way the Linux kernel handles memory usage, in particular activating and deactivating memory compression by zram and zswap.
Page : https://gitlab.com/Robin-antiX/antix-memory-manager
How to install :
Click bin > antiX-memory-manager > click download button
Add extension .sh example antiX-memory-manager.sh
Make shell script executable
Run from terminal
Support
For help, questions, suggestions and bug reporting please write to antiXlinux forums.
Contributing
If you find a translation of user interface or user manual being inadequat or misleading wrong, please edit it simply on antix-development at transifex. On transifex you may edit the string translations used in user interface directly.
If you happen to have knowledge and want to help improving this tool, please bark up in antiX forum (see Support link above).
Authors and acknowledgment
This is an antiX community project. In particular many thanks to anticapitalX and anti-apXos !

Before

After
antiX memory manager is a Control centre script allowing for checking and managing the way the Linux kernel handles memory usage, in particular activating and deactivating memory compression by zram and zswap.
Page : https://gitlab.com/Robin-antiX/antix-memory-manager
How to install :
Click bin > antiX-memory-manager > click download button
Add extension .sh example antiX-memory-manager.sh
Make shell script executable
Code: Select all
chmod 755 antiX-memory-manager.sh
Code: Select all
sudo ./antiX-memory-manager.sh
For help, questions, suggestions and bug reporting please write to antiXlinux forums.
Contributing
If you find a translation of user interface or user manual being inadequat or misleading wrong, please edit it simply on antix-development at transifex. On transifex you may edit the string translations used in user interface directly.
If you happen to have knowledge and want to help improving this tool, please bark up in antiX forum (see Support link above).
Authors and acknowledgment
This is an antiX community project. In particular many thanks to anticapitalX and anti-apXos !

Before

After
Last edited by putih on Sat Jul 19, 2025 10:28 am, edited 2 times in total.
- Eadwine Rose
- Administrator
- Posts: 15259
- Joined: Wed Jul 12, 2006 2:10 am
Re: How to Add swap space
Please don't post screenshots of code output, they cannot be searched. You can post code on the forum like this:
[code]code output here[/code]
Thanks.
[code]code output here[/code]
Thanks.
MX-23.6_x64 July 31 2023 * 6.1.0-39amd64 ext4 Xfce 4.20.0 * 8-core AMD Ryzen 7 2700
Asus TUF B450-Plus Gaming UEFI * Asus GTX 1050 Ti Nvidia 535.247.01 * 2x16Gb DDR4 2666 Kingston HyperX Predator
Samsung 870EVO * Samsung S24D330 & P2250 * HP Envy 5030
Asus TUF B450-Plus Gaming UEFI * Asus GTX 1050 Ti Nvidia 535.247.01 * 2x16Gb DDR4 2666 Kingston HyperX Predator
Samsung 870EVO * Samsung S24D330 & P2250 * HP Envy 5030
Re: How to Add swap space
Thank you for posting this, @CharlesV
Re: How to Add swap space
Your very welcome.
*QSI = Quick System Info from menu (Copy for Forum)
*MXPI = MX Package Installer
*Please check the solved checkbox on the post that solved it.
*Linux -This is the way!
*MXPI = MX Package Installer
*Please check the solved checkbox on the post that solved it.
*Linux -This is the way!
Re: How to Add swap space
If MX is installed without specifying a swap partition , will it automatically use root partition file /swap ?
In which case we only have to ensure the root partition has enough free space (say 2x RAM size).
I always specify a root partition but for the most part it goes unused on systems with >4G RAM
In which case we only have to ensure the root partition has enough free space (say 2x RAM size).
I always specify a root partition but for the most part it goes unused on systems with >4G RAM
Re: How to Add swap space
If you use the 'automatic install using entire disk' option, a swap file will be created by default. If you use any of the custom install options, it is up to you to create a swap partition. or. follow these instructions to create a swap file post install:AA BB wrote: Sun Aug 10, 2025 12:00 pm If MX is installed without specifying a swap partition , will it automatically use root partition file /swap ?
In which case we only have to ensure the root partition has enough free space (say 2x RAM size).
I always specify a root partition but for the most part it goes unused on systems with >4G RAM
https://www.digitalocean.com/community/ ... -debian-11
HP 15; ryzen 3 5300U APU; 500 Gb SSD; 8GB ram
HP 17; ryzen 3 3200; 500 GB SSD; 12 GB ram
Idea Center 3; 12 gen i5; 256 GB ssd;
In Linux, newer isn't always better. The best solution is the one that works.
HP 17; ryzen 3 3200; 500 GB SSD; 12 GB ram
Idea Center 3; 12 gen i5; 256 GB ssd;
In Linux, newer isn't always better. The best solution is the one that works.