How to make up more free memory in Android?

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

How to make up more free memory in Android?

跳至解决方案
2,959 次查看
PeterChan
NXP Employee
NXP Employee

Hello All,

 

I would like to reserve more free RAM space for running applications. My idea is to make the kernel and Android code size smaller by removing un-desired features and drivers. For kernel, I can use "make menuconfig" to configure it. For Android, does it offer any configure options?

 

My another question is in kernel, devices "pmem_adsp" and "pmem_gpu" are created for the Android. How to determine the required size to these pmem devices? Can I make these size smaller?

 

My BSP release is i.MX50 R10.3.

 

Thanks,

Peter

标签 (1)
标记 (2)
0 项奖励
回复
1 解答
2,006 次查看
lily_zhang
NXP Employee
NXP Employee

hello, all:

Suggest that you can work out one memory layout according to your feature lists.

We have put one memory optimization example for MX53 under

https://community.freescale.com/docs/DOC-93334

Hope it's helpful.

在原帖中查看解决方案

0 项奖励
回复
8 回复数
2,006 次查看
chenguoyin
NXP Employee
NXP Employee

You can customize the file ./imx50_rdp/required_hardware.xml to remove those feature you dont need in android framework.

And remove those service/daemon you dont need in init.rc

"pmem_adsp": is use as a physical-continuous buffer allocator for hardware video decoder and encoder. Since there is no vpu in mx50, you can remove the pmem_adsp in kernel

"pmem_gpu": is use as the physical-continuous buffer allocator for the android hal Gralloc. Android framework use the allocator to allocate the buffer for UI surface. It is highly dependents on your device display's resolution.

The size  >= 5* display_w × display_h *sizeof(RGBA8888) * 2


0 项奖励
回复
2,006 次查看
wenpengqiu
Contributor I

Hi Guoyin, Xiaoli

About pmem_gpu, it seem that your formula is not consistent.

Maybe 5 layers is the maximum layers in practical, and 31 is theoretical maximum, is it?

which one you recommend

Thanks

0 项奖励
回复
2,006 次查看
chenguoyin
NXP Employee
NXP Employee

Yes, you are right about the max layers Andorid framework may have. But in practice,  we never see the user case you have more than 5. And considering not all the layer has the same size of display resolution and the memory fragment in the pmem_gpu, you may need to set the layers number be greater than 5. A safety number can be 8~10, i guess.

2,007 次查看
lily_zhang
NXP Employee
NXP Employee

hello, all:

Suggest that you can work out one memory layout according to your feature lists.

We have put one memory optimization example for MX53 under

https://community.freescale.com/docs/DOC-93334

Hope it's helpful.

0 项奖励
回复
2,006 次查看
wenpengqiu
Contributor I

Hi Xiaoli,

Our environment:

800*480 display resolution,

Support 720P

Not support dual display

About vpu pmem, your formula: 1920*1080*1.5*19=56M, according to our project: 1280*720*1.5*19=26265600.

So, is 32M enough?  does mem fragment influence it?

Thanks

0 项奖励
回复
2,006 次查看
chenguoyin
NXP Employee
NXP Employee

32M is enough for your 720P video playback. And if your user case doest not include multiple instance of video playback. 32M is enough for your device.

0 项奖励
回复
2,006 次查看
wenpengqiu
Contributor I

It's really helpful

Thanks

0 项奖励
回复
2,006 次查看
KrishnaPavan
Contributor II

I would like to be in loop.

We, can remove some unwanted modules from Kernel is all I know. Vanilla Kernel is an example for that.

Would like to know, if there's any such, for android.

0 项奖励
回复