vr-25 / zram-swap-manager Goto Github PK
View Code? Open in Web Editor NEWA versatile zRAM swap manager with dynamic swappiness - for Android and GNU/Linux systems.
License: GNU General Public License v3.0
A versatile zRAM swap manager with dynamic swappiness - for Android and GNU/Linux systems.
License: GNU General Public License v3.0
Is this configuration item mem_percent=33 # [33], memory limit·
the option to control the size of zram?
I'm having problems modifying this option, for example, if I set 33%, the actual memory allocated is about 66% RAM.
My phone has 6G RAM, is the phone you are using for development the 12G RAM version?
Can you tell me the function of this configuration item, vm="swappiness=80 page-cluster=0· What is the function of ·vm="swappiness=80"
?
Will modifying this /sys/module/lowmemorykiller/parameters/minfree
file will change the phone's memory recycling policy?
My phone kills memory when 1GB of memory is left after zRAM is turned off, which leads to underutilized memory, I think it is more appropriate to kill memory when 256MB is left.
Hello!
Thank you for this Magisk module! I was trying to modify the ZRAM size for my device but it simply did not work, the device would freeze every time I tried to use swapoff
but your module worked like a charm!
I also tried to modify some other parameters related to swap, for instance:
vm="swappiness=80 page-cluster=0 watermark_scale_factor=125"
but it did not work. I have to add this to a custom service.d script for it to work, maybe it can be used to improve the reliability of your startup scripts as well:
#!/system/bin/sh
while [ "$(getprop sys.boot_completed)" != 1 ]; do
sleep 1
done
sysctl -w vm.watermark_scale_factor=125
Regards
After installation (magisk --install-module //sdcard/zsm_android_2023-07-17_19.26.51.zip) module got deleted after reboot because here is a folder /data/adb/modules_update/ram-swap-manager with 3 files.
hammerhead:/sdcard # zsm -n
grep: /sys/block/zram0/comp_algorithm: No such file or directory
cat: can't open '/sys/block/zram0/comp_algorithm': No such file or directory
Swapspace size: 1805116k, UUID=25a4ddcd-7c67-49a9-bdc7-5f905a338a42
hammerhead:/sdcard #
Hello, magisk supports module updates from within the app itself, if the module has proper fields in module.prop and appropriate update.json file upstream (see https://topjohnwu.github.io/Magisk/guides.html). Could you provide these?
Can we have support for KernelSU
cant i disable zram at boot without waiting by edit config.txt ?
It's missing } in line 5, resulting error on accessing in terminal.
zsm does not have an option to show actual compression rate and total size.
easy to obtain:
/sys/devices/virtual/block/zram0/compr_data_size
/sys/devices/virtual/block/zram0/orig_data_size
/sys/devices/virtual/block/zram0/mem_used_total
Default ./service.sh starts zram with following arguments '-dr' which causing infinite log spamming:
https://paste.debian.net/1306119/
65: '[' -x /data/adb/vr25/bin/swapoff ']'
65: >/dev/null
65: which /data/adb/vr25/bin/swapoff
65: '[' -x /vendor/bin/swapoff ']'
66: eval /vendor/bin/swapoff /dev/block/zram0
66: /vendor/bin/swapoff /dev/block/zram0
66: echo '(i) Trying alternative: /vendor/bin/swapoff...'
(i) Trying alternative: /vendor/bin/swapoff...
65: '[' -x /system/bin/swapoff ']'
66: eval /system/bin/swapoff /dev/block/zram0
66: /system/bin/swapoff /dev/block/zram0
66: echo '(i) Trying alternative: /system/bin/swapoff...'
(i) Trying alternative: /system/bin/swapoff...
65: '[' -x /vendor/bin/swapoff ']'
66: eval /vendor/bin/swapoff /dev/block/zram0
66: /vendor/bin/swapoff /dev/block/zram0
66: echo '(i) Trying alternative: /vendor/bin/swapoff...'
(i) Trying alternative: /vendor/bin/swapoff...
65: '[' -x /sbin/swapoff ']'
'zsm -n' works tho..
EDIT: that why I recommend have 'sleep 1' in a loop scripts to prevent 100% CPU load and battery drain.
After changing config, using zsm -r cannot apply the new config. Instead it will cycle between shrinking and growing swap. I had to reboot the phone everytime.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.