mirror of
https://github.com/tytydraco/KTweak.git
synced 2024-11-04 06:00:43 +00:00
Set ZRAM to half of the accessible system RAM
Signed-off-by: tytydraco <tylernij@gmail.com>
This commit is contained in:
parent
47ab8a34ea
commit
0035d737b1
13
service.sh
13
service.sh
@ -181,4 +181,17 @@ do
|
||||
[[ "$avail_scheds" == *"none"* ]] && write "${queue}scheduler" none
|
||||
done
|
||||
|
||||
# ZRAM
|
||||
if [[ -d "/sys/block/zram0" ]]
|
||||
then
|
||||
memsize=`cat /proc/meminfo | grep "MemTotal" | awk '{print $2}'`
|
||||
halfmemsize=`echo "$memsize/2" | bc`
|
||||
|
||||
swapoff /dev/block/zram0
|
||||
write /sys/block/zram0/reset 1
|
||||
write /sys/block/zram0/disksize "${halfmemsize}KB"
|
||||
mkswap /dev/block/zram0
|
||||
swapon /dev/block/zram0
|
||||
fi
|
||||
|
||||
echo "[*] Done."
|
Loading…
Reference in New Issue
Block a user