Library for unrestricted heap memory for bitmaps using NDK on Android [closed]

时光总嘲笑我的痴心妄想 提交于 2019-12-04 08:44:17
fadden

The heap limit on recent 2GB devices is around 192MB. Apps that need a large amount of memory, such as image editors, can include android:largeHeap=true in the app manifest to increase that to a higher limit (currently around 512MB).

Working around the limits is generally a bad idea. It's calibrated on each device based on the amount of physical memory, the display size, and how the device performs when it has a bunch of apps running. Remember that, on Android, your app isn't the only thing present, and not all of physical memory is reserved exclusively for apps (a big piece goes to the kernel, buffers for multiple frames of graphics and video content, and so on).

The bigger your app is, the more likely it is to be killed. The kernel tries very hard to not kill the foreground app, which means you're going to start squeezing out background processes -- or cause them to do so much paging and restarting that it starts to impact the performance of your game.

Having said all that, I think you're looking for this.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!