Linux中保留内存(Reserved memory)是指把系统中的一部分内存保留起来,内核不会为它建立页表,一般的应用程序无法访问到这段内存。
通常安卓手机,比如是256M的内存大小,实际中安卓可以使用的会小一些,即通过cat /proc/meminfo得到的TotalMem大小为180M左右,那么剩余的内存去哪里了呢?
其实MODEM,GPS等其它模块也要占用一部分内存,那些不可见的76M是预留出来给MODEM等模块使用。
查看预留内存
cat /d/memblock/reserved
查看详细的预留内存分配
shell@sp9820e_2h10:/d/memblock $ cat reserved 0: 0x80004000..0x80007fff 1: 0x80008280..0x80b10697 2: 0x85400000..0x85433fd6 3: 0x85500000..0x85743383 4: 0x877ff000..0x87bcffff 5: 0x88000000..0x8827ffff 6: 0x88300000..0x8845a7ff 7: 0x89600000..0x8cffffff 8: 0x8e000000..0x8e1fffff 9: 0x8ed74f80..0x8eda4fbb 10: 0x8eda4fc0..0x8eda4ffb 11: 0x8eda5000..0x8edbd077 12: 0x8edbd080..0x8edbd087 13: 0x8edbd0c0..0x8edbd0c7 14: 0x8edbd100..0x8edbd103 15: 0x8edbe140..0x8edbf315 16: 0x8edbf340..0x8edbf515 17: 0x8edbf540..0x8edbf715 18: 0x8edbf740..0x8edbf743 19: 0x8edbf750..0x8edbf792 20: 0x8edbf794..0x8edbf7b2 21: 0x8edbf7b4..0x8edbf7d2 22: 0x8edbf7d4..0x8edbf7f2 23: 0x8edbf7f4..0x8edbf812 24: 0x8edbf814..0x8edf939b 25: 0x8edf93a8..0x8edf9fdf 26: 0x8edf9fe4..0x8edf9ffe 27: 0x8edfa000..0x8ffbffff
cat /d/memblock/memory
查看总的预留内存
shell@sp9820e_2h10:/d/memblock $ cat /d/memblock/memory 0: 0x80000000..0x8ffbffff