Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does Android support Virtual memory

Does Android support virtual memory concept? I read it does use paging but not swap space. That is, it relies heavily on being able to mmap() files and have the kernel page in data from the file as needed (and drop those pages when not needed). It does not however use swap space for paging out dirty pages.

Can some body please elaborate ?

like image 829
shunty Avatar asked Jun 29 '12 09:06

shunty


2 Answers

Android does support virtual memory concept. And Android kernel does support swap.You can confirm it by looking up "CONFIG_SWAP=y" in the .config file of kernel source.

But enabling swap should also use a swap partition and run "swapon". So, though the kernel support SWAP, the android kernel don't use it. You can also confirm it by "cat /proc/meminfo" in adb shell of android.

PS: Paging and swap space is not the same thing.

like image 146
Haifeng Li Avatar answered Oct 30 '22 21:10

Haifeng Li


Here are some links related to android memory management. http://mobworld.wordpress.com/2010/07/05/memory-management-in-android/ http://android-developers.blogspot.kr/2011/03/memory-analysis-for-android.html

Android uses virtual memory but swap partition is not enabled in android kernel

like image 33
LKL Avatar answered Oct 30 '22 20:10

LKL