Open robintwiggs opened 2 years ago
Thanks, i will push this change as a commit with your name on the author field.
Thanks,
Another minor tweak I discovered is necessary on systems with systemd installed
otherwise you get this error - even when using the 'service' command:
zram.sh needs to have a shebang at the top of the file - for which I used the following as the code in the script is sh:
Hi There,
Thanks for sharing this code, which I have found to be accurate and useful.
I've made a small modification to zram.sh which you may find useful.
After 'PRIORITY=100': MEM_LIMIT_PERCENTAGE=0
Before 'echo "zram device initiated"': if [ ${MEM_LIMIT_PERCENTAGE} -gt 0 ]; then MEM_LIMIT_SIZE=$(( MEMORY_TOTAL * MEM_LIMIT_PERCENTAGE / 100)); echo "${MEM_LIMIT_SIZE}" > /sys/block/zram0/mem_limit fi;
This allowed me to set MEM_LIMIT_PERCENTAGE=20 and RAM_PERCENTAGE=60 in /etc/default/zram-config when I'm expecting a compression ratio of 3, so that I can be confident my MEM_LIMIT_PERCENTAGE will not be exceeded under any conditions.