近段时间,有不少用户称 iOS 10 系统的内存不够用,导致应用闪退,而为了解决这个问题,小编给大家分享了一个开启 iPhone 虚拟内存的方法(链接)。那么问题来了,虚拟内存到底是什么呢?

修改虚拟内存并非修改 iPhone 的内存。虚拟运存是需要占用手机一定的内存的,所以修改多少需要根据 iPhone 的内存大小来决定。
而在修改虚拟内存方面,请参考以下办法:

1. 在 Cydia 中下载 MobileTerminal 以及 iFile。
2. 开启 MobileTerminal。
3. 输入 su 和 Root 密码(预设为 alpine)。
4. 输入 dynamic_pager -H 5242800 -S 536870912 -L 570425344 -P 1。
5. 开启 iFile 并查看 var/vm 下是否有一个 512M 的 swapfile0 档案。
6. Reboot,修改 512MB 虚拟内存成功。

若将第四步中的代码更换,可以改为开启 256MB 和 1GB 虚拟内存,需要注意大小写及空格:
512MB 虚拟内存:dynamic_pager -H 5242800 -S 268435456 -L 301989888 -P 1
1GB 虚拟内存:dynamic_pager -H 33554432 -S 1073741824 -L 1140850688 -P 1

需要修改 vm 文件夹权限才能生成虚拟运存的文件。另外,重启 iPhone 或者直接删掉文件再重启则可以关闭虚拟内存,注销并不能关闭。