Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Robin Twiggs #1

Open
robintwiggs opened this issue Feb 26, 2022 · 2 comments
Open

Robin Twiggs #1

robintwiggs opened this issue Feb 26, 2022 · 2 comments

Comments

@robintwiggs
Copy link

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.

@eylles
Copy link
Owner

eylles commented Feb 26, 2022

Thanks, i will push this change as a commit with your name on the author field.

@robintwiggs
Copy link
Author

robintwiggs commented Feb 26, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants