Android :: DDMS Heap Debug?

Nov 5, 2009

what do the following mean in the Heap view of *DDMS*:

1) Data Object

2) Class Object

3) 1,2,4,8-byte *array* : which arrays are we talking about here??

4) non- Java object

Android :: DDMS Heap debug?


Android :: DDMS Heap Dump Permissions?

Sep 1, 2010

I'm trying to get a heap dump from ddms in Eclipse, but it gives me the following error:

"Unable to create HPROF file for application 'space.shhh'. Check logcat for more information."

And here is the logcat output: D/ddm-heap(19153): Heap dump: file='/sdcard/com.bunnies.Shhh.hprof' E/dalvikvm(19153): hprof: can't open /sdcard/com.bunnies.Shhh.hprof- hptemp: Perm ission denied.

I've tried this on an actual device (HTC Desire w/ 2.1 Eclair) and an emulator (Donut). Both gave exactly the same result as above. Also, I do have the WRITE_EXTERNAL_STORAGE permission in the manifest.

View 4 Replies View Related

Android :: Debug Memory Leak Where Exception Instances In Heap Dump Have No Inbound References?

Sep 2, 2010

I've been trying to diagnose a memory leak in an Android application I'm writing. I got a heap dump loaded into Eclipse, but the results I'm seeing are very curious. There are some 20,000 instances of an exception (specifically, LDAPException from the UnboundID LDAP library) in the heap with no inbound references.

That is, they show up at the root of the dominator tree. The OQL SELECT objects e FROM com.unboundid.ldap.sdk.LDAPException e WHERE (inbounds(e).length = 0) returns over 20,000 results, totalling to nearly all of the heap. And yet, the GC runs before the heap dump and I can see that it's running in the console, repeatedly, during the execution of the leaky code. If these instances have no inbound refs, what could be keeping them alive?

I also tried doing a "shortest paths to GC" query. It shows one LDAPConnectionReader row retaining 2 instances, and ~20k LDAPException @ <addr> unknown rows with various hex addresses.

Update: I haven't had time to further diagnose this since posting it, and the bounty I posted is ending before I likely will. I'm awarding it as best I can now, lest the points go to waste. Thanks to everyone who looked into this! I will come back later and update again with the results of further diagnosis, when life is a little less hectic.

View 3 Replies View Related

Android :: DDMS Not Listing Process - Via Command Line To Attach Process To Debug

May 21, 2010

Sometimes the DDMS in the Eclipse not listing the process.

To do the debug in this condition,

1) Is their any way force the DDMS to list the process?

2) Any command to attach the process from the command line?

View 2 Replies View Related

Android :: Application Max Heap Size

Oct 27, 2009

I noticed when you create an AVD now that you can set an application max heap size. I found that when I did WVGA800 it was set to 24. So it looks like it's more than the 16 we are used to.

I there an API method to get the value of this max heap size? I haven't looked into that yet.

View 4 Replies View Related

Android :: Limit Of Memory Heap Only 6M?

Jun 30, 2009

07-01 11:32:02.192: VERBOSE/QualcommCameraHardware(35): state transition QCS_WAITING_JPEG --> QCS_IDLE 07-01 11:32:02.232: ERROR/dalvikvm-heap(395): 6291456-byte external allocation too large for this process. 07-01 11:32:02.232: ERROR/(395): VM won't let us allocate 6291456 bytes 07-01 11:32:02.242: DEBUG/AndroidRuntime(395): Shutting down VM 07-01 11:32:02.242: WARN/dalvikvm(395): threadid=3: thread exiting with uncaught exception (group=0x4000fe70) 07-01 11:32:02.242: ERROR/AndroidRuntime(395): Uncaught handler: thread main exiting due to uncaught exception 07-01 11:32:02.302: ERROR/AndroidRuntime(395): java.lang.OutOfMemoryError: bitmap size exceeds VM budget My app shut down when i load a jpg file,i can avoid it by call system.gc().But I think memory limit will be 14M or 16M.

View 24 Replies View Related

Android :: 16M Application Heap Limit

Aug 31, 2009

Does the 1.5 SDK still have the 16mB application heap limit? Is there any way to change it? Do you think this limit will persist into the forseeable future?

View 3 Replies View Related

Android :: Why Application Has Less Heap Memory Than Others?

Nov 18, 2010

My question may look naive but I do not know how to formulate it more correctly. The problem is that I create and use large simple type arrays in my application.

And I get errors like: ERROR/dalvikvm-heap(1763): Out of memory on a 7907344-byte allocation.

Yes, it's big enough but task management tools claim that my application is using only 30MB of memory, while other at the same time use 50MB and even 110MB (have seen once) and there is still 190MB of free memory in the system (not system applications, just other ordinary applications I have installed). If all applications are provided with the same heap size at startup how can they grow so big?

View 1 Replies View Related

Android :: Heap Limit And Resources

Nov 2, 2009

I'm an Android game developer and I need to ask you a couple of questions about Android heap limit.

Does the 16 MB heap limitation also applies to OpenGL ES textures or SoundPool sound effects? Since they are managed by native code, is it correct to affirm that there is no problem in using more than 16 MB of RAM in app/game resources/assets? If it is possible right now, it is guarantee to be possible in the future?

View 3 Replies View Related

Android :: Memory Management Outside Heap

Jan 15, 2010

I am working on an application for android and we since we have lots of graphics, we use a lot of memory.

I monitor the memory heap size and its about 3-4 Mb , and peeks of 5Mb when I do something that requires more memory (and then goes back to 3). This is not a big deal, but some other stuff is handled outside the heap memory, like loading of drawables.

For example if I run the ddms tool outside eclipse, and go to sysinfo, I see that my app is taking 20Mb on the Droid and 12 on the G1, but heap size are the same in both, because data is the same but images are different.

So the questions are: How do I know what is taking the memory outside the heap memory? What other stuff takes memory outside the heap memory? Complex layouts (big tree) ? Animations?

View 2 Replies View Related

Android :: Eclipse Heap Tool?

Jul 17, 2010

So from my understanding each application normally gets 16 mb memory to work with. This is what is shown on the heap tool for eclipse:

Heap Size: 4.5 mb
Allocated: 3.2 mb
Free : 1.5 mb
Used : 66.7%

Which one is the total memory being used? Heap size, or Allocated?

View 1 Replies View Related

Android :: Matrix.rotateM Does Heap Allocations

Sep 24, 2010

Are you meticulous in removing all per-frame heap allocations from your game? (At least the allocations that you can control and that have practical alternatives.)

While trying to reduce per-frame heap allocations from my running game, I found that method

android.opengl.Matrix rotateM(float[] m, int mOffset, float a, float x, float y, float z)

Does a heap allocation. This means maybe 10 or so extra heap allocations per frame and is the only per-frame allocation left in my application (well, the only one that I can directly control). I am thinking of replacing this with my own version - one that does not do any heap allocations.

I also had some lists that I replaced with my own list implementation because I found that some standard list iterations would create new iteration objects, putting more pressure on the heap and forcing more frequent garbage collection.

I know that I can't eliminate all the heap allocations. In particular, input seems to trigger a bunch of allocations.

I can't help but think that anything reasonable I can do to reduce pressure on the heap will improve the user's experience (if garbage collection is going to stall my game). Obviously there are diminishing returns at some point, so ultimately I have to make a judgement call.

View 8 Replies View Related

Android :: Programmatically Get Maximum Heap Size

Oct 15, 2009

I have an app which does a bunch of image manipulations, and those images are ideally full-screen sized. It works on a G1 (or HVGA emulator), but runs out of memory on a WVGA emulator instance, because full-screen images use twice as many pixels. Fine, I can work around it by manipulating smaller images, then scaling up to WVGA at the end. There's some loss of image quality, but this is unavoidable on a WVGA device with a 16MB heap limit, so I'll live with that.

When a real WVGA device hits the streets in the next couple of months, though, it's likely to have more than 16MB heap per app, for just this kind of reason. So for best image quality, I'd like my app to adapt to this situation, and use full-screen-sized images on such a device. IOW, I'd like to implement a heuristic which sets the image size based on heap size.

In order to do so, however, the app needs to know what the maximum heap size is, and I haven't yet found an SDK call which will return this information. The various Debug.get* memory calls all seem to be to do with how much heap you have *allocated*, not how much you theoretically *can* allocate. I understand that this isn't necessarily a hard number, that issues like fragmentation and GC mean that you may not actually be able to allocate every last byte, but a theoretical number would still be useful.

Can anyone point me to an SDK call I've missed?

View 4 Replies View Related

Android :: Memory Leak - Heap Size

Aug 10, 2009

I know that's a subject which was discuss a lot of time and I try to find a solution since more than 6 day for the memory leak which appears in my application.

I've read this page: http://www.curious-creature.org/2008/12/18/avoid-memory-leaks-on-andr...

So, I don't use static member fields, I always use recycle() and I don't use inner class.

My application use a gallery and some bitmap. I use finalize to monitor garbage collection in each class of my application: protected void finalize() throws Throwable {try {Log.d("FINALIZE", this.toString());} finally {super.finalize();}

View 2 Replies View Related

Android :: Set Minimum Heap Size For Each Application

Mar 3, 2010

I could set minimum heap size in the source code like below.

--> VMRuntime.getRuntime().setMinimumHeapSize(INITIAL_HEAP_SIZE);

But I want to set this value in android.mk or androidmanifest.xml.

View 7 Replies View Related

Android :: Increase Vm Heap Size In Phone

Sep 29, 2010

I am developing an application in android..but i got an issue of getting an error..that is out of memory exception while i am converting my file contents to byte array..i think this is the problem of reduced heap size..can u plz tell me how can i increase the vm heap size..i am using eclipse...

View 1 Replies View Related

Android :: Detect Application Heap Size

Apr 13, 2010

How do you programmatically detect the application heap size available to an Android app?

I heard there's a function that does this in later versions of the SDK. In any case, I'm looking for solution that works for 1.5 and upwards.

View 3 Replies View Related

Android :: OutOfMemory With 9M Free Heap Because Of Bitmaps!

Mar 3, 2010

Our app has some memory peaks, which let the heap grow to 13M. After the peak, there's 9M of free heap. Everything's fine until Bitmap objects come into play. Despite having 9M of free heap creating Bitmaps, which have only some 100k, now fail with a OutOfMemoryException!

My theory: Allocation fails if (Java) heap *size* plus external allocations (e.g. Bitmaps) exceed 16M, no matter that there is lots of free memory in the heap. The VM could shrink the heap, but actually does not. Would be quite a flaw in the VM.

Does anyone share this theory?

On the downside of this theory: I do not see anything appropriate (killing the process is probably not) an app developer could do to prevent those OutOfMemoryExceptions given that those memory peaks are legitimate and unavoidable.

View 18 Replies View Related

Android :: Java Runs Out Of Heap Space

May 21, 2009

I forgot to mention that I am using a third party JAR file that includes about 2900 classes.

View 3 Replies View Related

Android : Looking At Heap Bitmap Memory Per Session?

Feb 26, 2009

Ok I am at the end of my rope. I am doing some image processing. I have a large image file which I open and create a smaller bitmap from. At the end of processing I call recycle on everything. I null everything. I run GC manually.

I then try edit another image and I get an out of VM memory error. Bitmap exceeds etc etc.

I am looking at the heap and the secone edit doesn't seem to cause it to increase at all.

What else can I do. Surely google cannot possibly be suggesting that we can open one large bitmap per session and thats it?

View 16 Replies View Related

Android :: Out Of Memory On Bitmap But There Is Free Heap Space

Aug 10, 2010

I have a list view that display about 25 images with size 60x60 pixels. I dowload this images from internet and I store in an arraylist as Bitmap. I need to save it in a arraylist because a listview will recycle views and so I need, wenn the user scroll, to display the image in the new view WITHOUT downloading again from internet

But after some time I got

java.lang.OutOfMemoryError: bitmap size exceeds VM budget

It seams that I got this exception about after loading 20 images ...

Reading in forum I have read about memory heap.

I try to check the memory heap usage with: Debug.getNativeHeapAllocatedSize and Debug.getNativeHeapSize()

When the exception occours both are about 4M.

But android has more than 4M?

When the application start the values are a little less to 4M so it seams is not a big memory usage or memory leak.

To be sure I want to call : ActivityManager.getMemoryClass() but this method is and instance method and I can't find the object to invoke!

But this method say, that al min should an application have 16M!

Any help? I have seen many topics in google ... but all speak about recycle. But if I recycle a bitmat ... then should I download again from internet?

Should I store the image on flash memory or sd card instead an arraylist in memory?

View 6 Replies View Related

Android :: Get Total App Memory - Heap - External Allocations

Jul 7, 2010

In my android app, is there any way to get the total amount of memory my application is taking up, in the code. I'm using lots of large bitmaps, so it must include external allocations as well. I must, however, be able to get the number in the code, so that I can dynamically adjust to fit the budget I have.

I also need a way to get the total amount I have available (16Mb or 24Mb) as well.

View 1 Replies View Related

Android :: Objective Of Setting The Minimum Heap Size In An App

Oct 5, 2009

In google's Calendar app for Android OS, you will encounter this line in the onCreate method of CalendarActivity.

// Eliminate extra GCs during startup by setting the initial heap size to 4MB.
VMRuntime.getRuntime().setMinimumHeapSize(INITIAL_HEAP_SIZE)

Can someone explain why setting it to 4MB will eliminate GCs ? Thanks

View 1 Replies View Related

Android :: Reduce Heap Size To Get Space For BitmapFactory.decodeFile

Nov 16, 2010

I learned from several discussions of this group that BitmapFactory.decodeFile() allocates heap memory outside of the "java heap". My app receives encrypted files from a remote server. Decoding those files needs a lot of heap space. After finishing this decoding step most of the allocated heap space will be freed by the GC. But the (total) heap size - as displayed by the DDM - remains large. In this situation there is not enough heap space outside of the "Java heap" to decode even medium sized image files using BitmapFactory.decodeFile(). At the moment I limit the size of encrypted files to ensure that the Java heap space never increases to more than 10 MB. This ensures that there is enough memory for BitmapFactory.decodeFile(). But this is not very elegant.

Is it possible to tell the dalvik-vm to reduce the (total) heap size to have more space for decoding images or is there another solution?

View 6 Replies View Related

HTC Incredible :: Vm Heap Size

Aug 4, 2010

What exactly is this? What benefit do you get by changing it?

View 3 Replies View Related

HTC Incredible :: VM Heap Size 24m Vs 32m - 2.2

Jul 31, 2010

Anyone know (with our phones running 2.2) what the optimal heap size should be? The leaked 2.2 came with 24m preset. Some ROMs run 32m. Bigger always seems better, but I've been reading other sites/forums and get conflicting thoughts.

That's why I thought I'd ask here.

I ran Linpack with both and average about 37.5 - 37.9 with either 24m or 32m.

View 3 Replies View Related

Android :: Garbage Collection Infinite Loop - Clamp GC FOR MALLOC Grow Heap

Jul 6, 2010

I have a Service which uploads a big file to a webserver. This works fine on the emulator (android 2.1). But if i run it on a Nexus One Froyo phone it starts out fine. But after a while it is in an infinite GC loop. The whole phone becomes unusable:.........................

View 5 Replies View Related

Samsung Vibrant :: Heap 2 Warning On Sims 3

Jul 26, 2010

Has anyone gotten this warning? This is the warning i get Heap 2 out of memory. Allocating 276 bytes but only 424 available (172 LFB) increase icf setting [s3e] MemSize2 (current value is 5000000)

How do i increase icf setting or fix this any other way?

View 10 Replies View Related

Android :: Sdk - Jdk And Jre - Ddms

Dec 16, 2009

I am trying to debug my device from a windows system with no IDE, just the android sdk, jdk and jre. I am using the ddms to do so. I works fine. I can see the entries in the logcat in the ddms. Among others I can see 'Wrote stack trace to /data/anr/traces.txt". But when I select the Device->File Explorer... and try to open the data folder, there is nothing there. It looks like an empty data folder.

View 2 Replies View Related

Android :: SDK 2.0 Traceview In DDMS

Nov 20, 2009

I'm running the basic HelloActivity from the SDK 2. samples. When I try Trace view in the DDMS prespective its generate the trace file but can not opened. "'/sdcard/com.google.android.apps.uploader.trace': Permission denied". Do I need a permission to write in the SD card? 4:38.380: INFO/dalvikvm(10434): Debugger has detached; object registry had 1 entries 11-20 21:34:38.380: DEBUG/dalvikvm(10434): VM cleaning up 11-20 21:34:38.411: ERROR/AndroidRuntime(10434): ERROR: thread attach failed 11-20 21:34:38.466: DEBUG/VoiceDialerReceiver(1225): onReceive Intent { act=android.intent.action.PACKAGE_ADDED dat=package:com.example.android.helloactivity flg=0x20000000 cmp=com.android.voicedialer/.VoiceDialerReceiver (has extras) } 11-20 21:34:38.466: DEBUG/dalvikvm(10434): LinearAlloc 0x0 used 636716 of 5242880 (12%) 11-20 21:34:38.490: WARN/ResourceType(1015): Resources don't contain package for resource number 0x7f080000 11-20 21:34:38.490: WARN/ResourceType(1015): Resources don't contain package for resource number.....

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved