android开机自动开启zram,android zram

8 10 2013

android zram

android 内核中引入zram

Compressing pages and keeping them in RAM virtually increases its capacity. This allows more applications to fit in given amount of memory.

The usual argument I get is – memory is so cheap so why bother with compression? So I list here some of the use cases. Rest depends on your imagination 🙂

Netbooks: Market is now getting flooded with these “lightweight laptops”. These are memory constrained but have CPU enough to drive on compressed memory (e.g. Cloudbook features 1.2 GHz processor!).

Virtualization: With compcache at hypervisor level, we can compress any part of guest memory transparently – this is true for any type of Guest OS (Linux, Windows etc.). This should allow running more number of VMs for given amount of total host memory.

Embedded Devices: Memory is scarce and adding more memory increases device cost. Also, flash storage suffers from wear-leveling issues, so its useful if we can avoid using them as swap device.

缺点:需要更多cpu运算,功耗会增加.

50c50

< CONFIG_SWAP=y

> # CONFIG_SWAP is not set

2393,2395d2392

< CONFIG_ZRAM=y

< # CONFIG_ZRAM_DEBUG is not set

< CONFIG_ZSMALLOC=y

busybox swapoff /dev/block/zram0

dd if=/dev/zero of=/dev/block/zram0

echo 1  >/sys/block/zram0/reset

echo 167772160>/sys/block/zram0/disksize

busybox mkswap /dev/block/zram0

busybox swapon /dev/block/zram0

echo 100 > /proc/sys/vm/swappiness //根据需要来调,当系统有大内存时,可以完全不用交換,写为0.

Comments are currently closed.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值