Max size of an Android app's in

How large can be the database of my Android app? Is there a limit?

For performance and security reasons, I don't want to store the database on the SD card.


As far as reading up on it would suggest, there is no hard limit on the size of sqlite db on the internal storage other than the normal limits, ie. what is spare.

However some people are reporting exceptions occurring on larger databases, though I have yet to see anyone work out why.

Sadly the internal function to report max size isn't useful for this either, it seems set at 1TB.


On Android, if your in memory database becomes too large, the app will crash. What I've found to be a safe memory limit is the size returned by getLargeMemoryClass.

http://developer.android.com/reference/android/app/ActivityManager.html#getLargeMemoryClass()

I've found that the value returned from getLargeMemoryClass() is about half of what will totally crash the app--but that is with no other apps running.

For example, running my large in-memory database app on my Nexus 7 will crash when the database exceeds about one gigabyte. On the nexus 7 (running Lollipop at least) getLargeMemoryClass() returns 512MB

链接地址: http://www.djcxy.com/p/47848.html

上一篇: jQuery UI滑块和句柄

下一篇: Android应用程序的最大尺寸