No description
Find a file
2020-01-01 07:55:27 -08:00
install.sh Initial code push 2020-01-01 07:55:27 -08:00
LICENSE Initial commit 2019-12-22 22:59:31 -08:00
README.md Initial code push 2020-01-01 07:55:27 -08:00
zram-swap-service Initial code push 2020-01-01 07:55:27 -08:00
zram-swap.service Initial code push 2020-01-01 07:55:27 -08:00
zram-swap.sh Initial code push 2020-01-01 07:55:27 -08:00

zram-swap

Simple zram swap setup + teardown script with systemd unit & /etc/default configuration

https://github.com/foundObjects/zram-swap

Installation

git clone https://github.com/foundObjects/zram-swap.git
cd zram-swap && sudo bash install.sh

Usage

zram-swap.service will be started automatically during boot.

The default allocation creates a zram device that should use around half of physical memory when completely full.

Edit /etc/default/zram-swap-service if you'd like to change compression algorithms or swap allocation and then restart zram-swap with systemctl restart zram-swap.service.

Run zramctl during use to monitor swap compression and real memory usage.

Debugging

Either start zram-swap.sh with bash -x zram-swap.sh or ./zram-swap.sh -x (start|stop) to see what's going wrong.

To dump the full execution trace during service start/stop edit /etc/systemd/systemd/zram-swap.service and add -x to the following two lines:

ExecStart=/usr/local/sbin/zram-swap.sh -x init
ExecStop=/usr/local/sbin/zram-swap.sh -x  end