Skip to content Skip to sidebar Skip to footer

Alternative Of Vmruntime.getruntime().setminimumheapsize In Gingerbread

I know there's a VMRuntime.getRuntime().setMinimumHeapSize in Android 2.1/2.2 for developer to adjust the starting heap size of the application, and it is one of the most effective

Solution 1:

and it is one of the most effective solution sfor solving the OutOfMemory error during BitmapFactory.decodeStream()

Really? Setting the minimum heap size may reduce GC churn, but I would love to see links to places where it helped with OutOfMemoryErrors.

However, since Android 2.3, this VMRuntime class is removed from official API, does anyone knows the alternative API of this function in 2.3?

There is none. That behavior is no longer exposed.

Solution 2:

you can't increase the heap size dynamically.

you can request to use more by using android:largeHeap="true" in the manifest.

also, you can use native memory, so you actually bypass the heap size limitation.

here are some posts i've made about it:

and here's a library i've made for it:

Solution 3:

Similar answer to increase the heap size of the application

You cannot use VMRuntime post 2.2 but this functionality shall solve your purpose

Post a Comment for "Alternative Of Vmruntime.getruntime().setminimumheapsize In Gingerbread"