Page 1 of 1

"Using A Swap File To Increase Available Ram"

Posted: Sun Oct 27, 2024 5:44 am
by Jasper

Found this thread created by @wiak it is technical, but if you have the time it's worth a read :thumbup:

https://oldforum.puppylinux.com/viewtop ... lit=swapon


Re: "Using A Swap File To Increase Available Ram"

Posted: Sun Oct 27, 2024 2:37 pm
by wizard

A "swap file" or "zram swap" are common ways for Puppy computers with low amounts of ram to extend ram. These two techniques use different methods to achieve this.

Older Puppys can only use swap files. Newer Pups can use either.

NOTE: if a swap file exits in the /mnt/home directory, newer Pups will use it instead of creating zram

Swap files use space on a hard disk drive (on newer computers it might be on a eMMC or SSD drive)
Zram swap compresses existing ram to allow it to store more data.

Neither of these is a magic bullet substitute for real ram and if your programs require a sustained amount of swap, it will slow the computer to a crawl.

Swap File
This is the older of the two methods. A swap file is much slower than ram memory, but can allow your computer to run more demanding programs without crashing. Swap files are normally stored on an internal drive or USB hard drive

Swap files are not created on USB flash drives or SDcards.

On older Puppy versions, during your first shutdown, you may be ask if you want a swap file. You can also manually create a swap file (in both old or new Pups) by:
-open a terminal
-type: pupswap
-press: Enter

General Guidelines:
If you have 2gb or less of ram, create a 1024mb swap file.
-choose the Destination
-click: Create pupswap.swp

The file pupswap.swp will be created in the destination you choose.

swapfile.png
swapfile.png (32.29 KiB) Viewed 491 times

ZRAM Swap
Newer Pups will automatically setup ZRAM swap during boot (unless they find a pupswap.swp file) using
existing ram. This is the faster of the two methods. You will see this line displayed duriing boot:

Code: Select all

Loading zram swap

Using either method you can check the existence and status of the swap by:
-open a terminal
-type: free
-press: Enter

wizard


Re: "Using A Swap File To Increase Available Ram"

Posted: Fri Nov 08, 2024 6:55 pm
by dancytron

IIRC, @dmkr Puppies like Bookworm only set up zram below a certain amount of ram and has the settings optimized for Puppy. compared to the default Debian set up.