Low memory on Android

105 views
Skip to first unread message

Miracle Huang

unread,
Mar 6, 2017, 10:15:03 AM3/6/17
to android-platform

Currently, I want to use 1G RAM to run android on my phone.

According to android source website mentioned, enable kernel feature KSM and ZRAM to optimize the size of memory. But from my point, it seems that it is more sluggish for me.

 

Due to launch time is key point for user scenario in my opinion, I trace the android event logs to monitor the launch time. I found that time is longer than before. Although we only have 1G RAM, but I still try to optimize that.

 

Then I dump the /proc/meminfo to check memory status. But it seems that there is fewer free. Almost cached. So I regard that I need to transfer to cached memory to free. In my mind, launch time should be more faster if we have enough free, which doesn’t do memory reclaim at that time. It can help to save a lot of time for launch behavior.

 

I google on the internet for cache limit for my device, but that ideas may conflict with Linux kernel design aspect. There is only procfs interface on UNIX. But android kernel add a workaround extra_free_kbytes value to enlarge low watermark value based on same min_free_kbytes. That means kswapd will wake up earlier than before. In another word, the memory claim loading will be shared. Then I try to enlarge that. But it still get much improvement. The launch time is almost the same as which I don’t set that value. So I am confused.

 

Echo 81920 > /proc/sys/vm/extra_free_kbytes

/sys/bus/cpu/devices # free -m

                total        used        free      shared     buffers

Mem:              902         781         120          11           4

-/+ buffers/cache:            777         125

Swap:             451         217         233

 

And I also found that the launch time higher volatility value on my test.

 

My test method: do loop to load 30 apps on my android device.

 

Is that my test method wrong ? or any other I missed ?

Could you help to share me some test case to verify my ideas or correct me ?

 

Thx for your help!

Reply all
Reply to author
Forward
0 new messages