You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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.service: Failed at step EXEC spawning /etc/init.d/zram: Exec
format error
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:
#!/usr/bin/env 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.
The text was updated successfully, but these errors were encountered: