Questions tagged [android-largeheap]

An option in the application declaration in the Android Manifest that states whether your application's processes should be created with a large Dalvik heap

From the developer's guide:

Whether your application's processes should be created with a large Dalvik heap. This applies to all processes created for the application. It only applies to the first application loaded into a process; if you're using a shared user ID to allow multiple applications to use a process, they all must use this option consistently or they will have unpredictable results. Most apps should not need this and should instead focus on reducing their overall memory usage for improved performance. Enabling this also does not guarantee a fixed increase in available memory, because some devices are constrained by their total available memory. To query the available memory size at runtime, use the methods getMemoryClass() or getLargeMemoryClass().

14 questions
167
votes
6 answers

What are advantages of setting largeHeap to true?

I have an application with large number of classes & also many libraries are included, I am setting android:largeHeap="true" as i am getting memory issue, My Manifest file code is attached.
Intsab Haider
  • 3,491
  • 3
  • 23
  • 32
10
votes
5 answers

Bitmap recycle with largeHeap enabled

Before enabling largeHeap option, I was handling large bitmaps and it's consume almost the entire memory available for the application, and recycling it over navigation and loading new ones works round on almost the full heap available. However when…
Marcos Vasconcelos
  • 18,136
  • 30
  • 106
  • 167
8
votes
2 answers

What are the downsides of using android:largeHeap="true"?

Recently I've reduced the max memory peak of my application from 100 MB to 45 MB and I'm curious what are the downsides of using the android:largeHeap="true" other than the potential to push other applications out of memory? If the size doesn't grow…
ccoleman
  • 135
  • 2
  • 7
5
votes
0 answers

How do I run Android tests with largeHeap="true"?

We have a customer app made for tablets and we need more than the regular heap, so our app defines the largeHeap="true" attribute for the application tag in AndroidManifest.xml. This works fine. However, when we run tests on a device using…
donV
  • 1,091
  • 7
  • 15
3
votes
6 answers

Preserve the image quality when decode stream in android

I have an image on sdcard and need to show on the image view The problem is that after it has been decoded, it seems the quality is deteriorated. Are there any ways to keep the quality and at the same time preserve the memory? Or, if I used an…
user782104
  • 13,233
  • 55
  • 172
  • 312
3
votes
3 answers

Any way to use LargeHeap for v3.x and ignore for 2.x in Manifest?

I'd love to use the Android:LargeHeap="true" option in the Manifest to get a bit extra memory (we're dealing with 5+ MB bitmaps on high-res 1980x1200 displays and expect even larger displays shortly. I've run out of all the normal tricks to dealing…
Frank
  • 605
  • 1
  • 8
  • 14
2
votes
1 answer

How to fix java.lang.OutOfMemoryError in Android

I want develop android application and in this application use many methods. but sometime when work with application show me this error in LogCat : E/AndroidRuntime: FATAL EXCEPTION: main Process: ir.mototel.mototel, PID: 4899 …
Dj.Soa
  • 23
  • 1
  • 3
2
votes
0 answers

Android Error:(9, 36) error: code too large

I am using huge Multidimensional: Data array in a Java file and giving me an error Error:(9, 36) error: code too large.. And it's not compiling. Data is like this: String[][] Searchitems = new String[][]{ {"Maruti","1", "Swift", "1",…
1
vote
1 answer

Convert a BIG Picture object to Bitmap object Android.

I'm trying to get a image from a web view, but, when I call the "webView.capturePicture()" it bring me a Picture Object. In most cases this is enough to me use the follow code to convert it to a bitmap object Bitmap b =…
Carlos EduardoL
  • 670
  • 6
  • 14
1
vote
3 answers

Monodroid/Android use android:largeHeap on older devices

I'm using android:largeHeap in my Application to get more memory, because I have a large image in a scrollview, otherwise my application would crash with a outofmemory exception. I have 2 devices, one with Android 4.2 jellybean and another one with…
1
vote
2 answers

android:largeHeap="true" not working

Possible Duplicate: largeHeap=true manifest tag not working? I put android:largeHeap="true" in the application tag of the manifest file and set the minSdk version to android:minSdkVersion="12" and android:targetSdkVersion="15" but it does not…
Kevik
  • 9,181
  • 19
  • 92
  • 148
0
votes
0 answers

java.lang.OutOfMemoryError: Failed to allocate a 7144212 bytes allocation with 4194304 free bytes and 4MB until OOM

I am trying to generate images from a string array, by converting the string text to bitmap through paint canvas, and i am generating 50 images in a single activity. public View getView(int position, View convertView, ViewGroup parent) { …
0
votes
1 answer

android largeheap equated to true based on devices

I want to add in my manifest android:largeheap="true" based on some devices. Mostly devices running probably os 5.1 and below.Because alot of my clients are using samsung s3 , chinese , indian , pakistani phones.And I am getting lots of crashes in…
user3278732
  • 1,694
  • 10
  • 31
  • 67
-1
votes
2 answers

how increase memory for application

How to increase memory for application? E/GraphicsJNI(305): VM won't let us allocate 5529600 bytes I have this error and I'm trying apply largeHeap="true" but I'm getting an error: error: No resource identifier found for attribute 'largeHeap' in…