android determine GC freed object

my android application performance is low. from logcat i found that the time consuming factor is garbage collection. it consumes atleast 110ms in every gc. gc is showing frequently. Is there anyway to determine the collected objects??

-------------Problems Reply------------

Check out the videos in the

Especially the one talking on "Make your UI faster", there are a lot of design best practices shown in the videos.

It will definitely help your application to run faster.

In the DDMS tool, go to the "Allocation Tracker" tab. Select your app from the list, and click "Start Tracking". After using the app for a bit, select "Get Allocations".

This will show you the list of the 512 most recent allocations, with sizes and stack traces. From this you should be able to tell what is eating up memory and causing the GCs.

That's not an odd value for Android GC. The ~100ms and ~500K values are fairly average but that depends on the project specs of course.The real problem is in the frequency that your code causes the GC to be called.

Here's an example: If you implement lists via the ListView and some custom Adapters you could get the worst ever performance and the best ever depending on how you write your code for them. If you do not optimize lists and create a new View (by inflating it from the .xml file) you will get GC calls very often and this is perceived as small hickups or hangups in the UI.

The best method for determining of what causes the GC problem is localizing it. Start your app and use it one part an a time while monitoring the DDMS for GC gumps and then see which element or Activity causes most of them and go from there.

Also try memory usage monitoring with some tools. For instance if you are using Eclipse there is a tool called MAT that will give you a bit more insight into object usage throughout your project.

Category:android Views:0 Time:2010-11-03

Related post

  • Determine value of object in C# 2008-10-31

    What would be the best way to determine if an object equals number zero (0) or string.empty in C#? EDIT: The object can equal any built-in System.Value type or reference type. Source Code: public void MyMethod(object input1, object input2) { bool res

  • Determining whether an object is in a std::set 2009-05-04

    I'm trying to determine whether an object is already contained within a std::set. According to msdn (and other sources) the set::find function is supposed to return end() if it doesn't find the element you asked for. However when I implement code lik

  • .NET: How do I determine if an object is a COM object? 2010-02-26

    How do I determine if an object is a COM object? I need to call Marshal.FinalReleaseComObject on all COM objects in an array of type Object. --------------Solutions------------- Marshal.IsComObject typeof(myObject).IsCOMObject or instanceOfMyObject.G

  • How does the garbage collector determine whether an object is garbage? 2010-03-22

    How does the garbage collector determine whether an object is garbage? Does it refer to the stack to check the references to the space allocated in the heap? --------------Solutions------------- It employs a mark and sweep algorithm. The simplified v

  • FREED(id): message release sent to freed object error solution? 2010-04-14

    In my Iphone app I am getting: objc[597]: FREED(id): message release sent to freed object=0x3b81780 error.What should cause this error?IS it about memory allocation? I have UITable and model view that include some text field.It takes username from mo

  • How to avoid " FREED(id): message cover sent to freed object=0x398b8f0" 2010-06-07

    I've this code - (void)viewDidLoad { MoMagAppDelegate *delegate = (MoMagAppDelegate *)[[UIApplication sharedApplication] delegate]; self.issueList = delegate.issueList;//Line to error NSLog(@"IssueList size %d",[self.issueList count]); [super viewDid

  • How does Android determine whether to move the layout up when showing the softkeyboard? 2010-09-06

    How does Android determine whether to move the layout up when showing the softkeyboard? Note: I am aware that the activity property android:windowSoftInputMode="adjustResize|adjustResize|adjustUnspecified" exists, as described here http://developer.a

  • Determining if an object is a or a window 2010-11-17

    as far as I can see, it is possible to verify in JavaScript that a certain object is actually a div element: if (element.constructor == HTMLDivElement) { //... } How can I apply a similar check to see if the element is a window? Checking against DOMW

  • How to determine top most object in 2d projection of 3d object? 2010-11-19

    I have a surface to which a set of 3d objects is drawn. The task is to determine an object by the given coordinates on the surface. For example: some objects are drawn on the desktop application, I need to determine on which object user clicked. Coul

  • How to determine whether an object is a sequence 2010-11-24

    I can think of two ways to determine whether an object is a sequence: hasattr(object, '__iter__'). And whether calling iter(object) raises a TypeError. As it is most Pythonic to ask forgiveness than to ask permission, I'd use the second idiom, althou

  • Exception of using freed objects in rapid painting cycles 2011-03-03

    Summarization: For a Delphi function/procedure, if an instance of a class is passed through as an argument, another reference (besides the original reference) is created on temporary calling stack to point to that instance and is used locally. Thus,

  • realloc error: incorrect checksum for freed object 2011-04-12

    I try to wrote code that read data from stdin: size_t bufSize = 1024; unsigned char *msg = NULL; size_t msgBytes = 0; size_t inputMsgBufCount = 0; unsigned char inputBuffer[bufSize]; size_t bytesRead = 0; unsigned char *tmp = NULL; if ((msg = (unsign

  • How to determine whether an object was created using an object literal or an Object constructor call? 2011-04-20

    More specifically, how would you determine if a certain object was created using a literal or not? var s1 = new String(); var s2 = ""; // Literal var o1 = new Object(); var o2 = {}; // Literal var f1 = new Function(); var f2 = function(){}; // Litera

  • incorrect checksum for freed object - How do I troubleshoot on device? 2011-07-15

    I have spent several days trying to track down an error that many seasoned IOS developers have probably seen at one point or other in their career: MyApp-IPad(1403,0x5ab3000) malloc: *** error for object 0x2b3aa04: incorrect checksum for freed object

  • How to determine if an object is at rest? 2011-07-24

    Using the physics helper library. I'm trying to figure out how I can determine whether a physics object is at rest. Does anyone know how to do this or have any ideas of what I could do? An example scenario is a bouncy ball that can be picked up and t

  • 'Incorrect checksum for freed object' error after upgrading project to Xcode 4.2 and iOS 5 2011-10-28

    When I recently upgraded my iPhone to iOS 5 and upgraded Xcode, the project I've worked on for 5 months now has one error after another. Prior to this, I had successfully run Analyze and Profile without any issues. Now, I get one error corrected and

  • "incorrect checksum for freed object", but I didn't free it 2011-11-24

    Problem solved Thanks all for your engagement in my error searching! Thanks @Basile Starynkevitch for telling me about valgrind. Thanks @Anders K. for pointing out that it might have to do with the allocation/deallocation of x and w. The problem was

  • Obj-c, incorrect checksum for freed object - object was probably modified after being freed 2011-12-05

    I'm getting this error malloc: * * * error for object 0x8a591d4: incorrect checksum for freed object - object was probably modified after being freed. *** set a breakpoint in malloc_error_break to debug No memory available to program now: unsafe to c

  • incorrect checksum for freed object. Extremely strange crash on app 2012-01-17

    I've been working on an app for some time now.. Up until now i've been running it whilst the debugger has been attached and it was working well (because NSZombies was enabled)... I recently noticed that when pushing to a new view controller the app w

Copyright (C), All Rights Reserved.

processed in 0.197 (s). 11 q(s)