janithcooray / lin_os_swap_mod

increases the SWAP memory by an additional 4GB or 8GB for Android 7.0 or above
GNU General Public License v3.0
78 stars 6 forks source link

how to reduce the swap size to 2 gb? #2

Closed fedeharuchan closed 4 weeks ago

fedeharuchan commented 1 year ago

module working fine on my redmi 10c with cherish os, i use the swapped ram to boot some games on skyline emulator (the app crash without it). the rom already come with 2gb on the swap partition, and the total of 6gb is too much for me. 2 additional gb is probably enough, i prefer to have a bit more of storage tbh.

janithcooray commented 1 year ago

I have scheduled an update for this. it'll take till Saturday (3 days from today) to release the new update with more swap size options.

For the time being, what you can do is unzip the module and manually set a custom value on the customize.sh file

edit the following lines ( 31 & 32 )

    if $VKSEL; then
        ui_print "  Using 8GB"
        SWAP_BIN_SIZE=8192
    else
        ui_print "  Using 2GB" 
        SWAP_BIN_SIZE=2048
    fi

Re-compress using 7zip and flash via magisk

This will replace the default 4GB option with 2GB.

janithcooray commented 4 weeks ago

You can now unzip a module file and edit the variables in vars.ah to what you want

SWAP_BIN_SIZE=1048
# SWAPPINESS [0 - 100]
SWAPPINESS=60
SWAP_FILE_PRIOR=99999
SWAP_MOD_VERSION="v2.0-b"

Then rezip and install the module. make sure to zip it in a way that it does not zip the folder itlself.