How to enable swapping on S805 m201d?

  • I would like to enable swapping for the LibreELEC 8.2.3.1-m201d because AmLogic S805 TV Box has only 512 Mb RAM and freezes on the YouTube browsing.

    What I do:

    1) Set the build options to:

    Code
    1. SWAP_SUPPORT="yes"
    2. SWAP_ENABLED_DEFAULT="no"
    3. SWAPFILESIZE="256"

    and the Linux kernel options to:

    Code
    1. CONFIG_SWAP=y
    2. FRONTSWAP=y
    3. HIBERNATION=n
    4. MTD_SWAP=n
    5. ZCACHE=y
    6. ZCACHE_DEBUG=n

    2) Compile and create the developer release image, install the image to the SD Card and boot it.

    3) Customise the swap configuration file:

    Code
    1. #cp /etc/swap.conf /storage/.config/
    2. #sed -i 's/SWAP_ENABLED="no"/SWAP_ENABLED="yes"/' /storage/.config/swap.conf

    and create the file /storage/.config/autostart.sh with contents:

    Shell-Script
    1. #!/bin/sh
    2. sysctl -qw vm.swappiness=40


    But after all the swapping does not work:


    What is my mistake?

  • Hmm. Just tried on my S905x (LibreELEC (wrxtasy-kszaq): 8.2.4.2-S905Test-1529136339 (S912.arm)
    ) and it doesn't work.


    My guess is that swapping was NOT enabled in the kernel - for these devices it was not necessary (oodles of RAM).


    If you *really* need swap then you are doing something beyond the concept of LE or just doing too much for your box.

  • edjalmo : Thank you. I've did the same things on the S805 Box, but unsuccessfully.

    Iridium: You're right, swapping was not enabled in the kernel. Therefore I've rebuilt the kernel with the swapping support. And Linux creates the swap-file during booting process. But it doesn't use it in its work...