5

I am developing an application on Android 2.2 which takes extensive memory and my most operation cannot be complete because of low memory. Could anybody give me solution that how can I increase my application heap size. I have tried android:largeHeap="true" but it is not supported in Android API-8.

I am thankful you all.

Cool Java guy מוחמד
  • 1,687
  • 4
  • 24
  • 40
  • 2
    Can you provide more information about what operation cannot be completed? I think that the solution is maybe a better memory management. – peter.bartos Sep 29 '11 at 11:57
  • I think this tag supported in Honeycomb only as of now. Have seen this tag in tablet apps. – Jay Mayu Sep 29 '11 at 12:06

2 Answers2

6

Heap size depends on the hardware your running your app an. For example 16mb on a G1 and 32mb on a nexus one. Don't think there is much you can do about it. If you target versions below 3.0 that is.

pumpkee
  • 3,357
  • 3
  • 27
  • 34
1

Could anybody give me solution that how can I increase my application heap size.

You can't. Instead, you need to do a better job with the memory you have.

I have tried android:largeHeap="true" but it is not supported in Android API-8.

As Google has indicated, all using this will do is tend to irritate users of your app. Your app will consume more memory and therefore will kick other apps out of memory more quickly. Some users will not like this behavior. And, it is very possible that this will only ever be a tablet option -- I would not assume that Ice Cream Sandwich phones will necessarily support android:largeHeap.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491