Why does it always shows GC_CONCURRENT FREED and GC_CONCURRENT ALLOCATE in Android Logcat while running a app?
Solution 1
Garbage Collection is used by Java to prevent you from going Out of memory by removing Objects that are no longer referenced by any class and cannot be reached from your code.
If you have too many of these objects, you will get GC calls alot, which may at some times affect your performance. On the other hand, having Objects that are referenced all the time, may prevent GC from being called (memory leak) and your memory may fill up and you get an OutOfMemoryException
.
Your goal is not to eliminate GC, but reduce them as much as possible in methods that are delay sensitive and are running on the UI thread (like onDraw()
, getView()
, ... for e.g.).
Solution 2
That is normal behaviour for Android. The phone just does garbage collection. For more information checkout the great Google I/O video on this: Google I/O 2011: Memory management for Android Apps
Solution 3
Folks, check out these doc/links,its related to memory management:
http://therockncoder.blogspot.in/2012/09/fixing-android-memory-leak.html
G M Ramesh
EDI Analyst, I love helping people and i would love to take the same from the people also. I know: EDI Oracle Java Android “Do not be a hard-worker, but be a smart worker”
Updated on June 05, 2022Comments
-
G M Ramesh almost 2 years
I would like to know that why does the below message shows up everytime while running any application.
12-11 17:18:37.141: D/dalvikvm(3155): GC_CONCURRENT freed 485K, 9% free 6696K/7303K, paused 9ms+335ms
paused 9ms+335ms
due to this pause my audio which i supposed to play is missing, because as per my code it receives audio data every40ms
so here it paused for9ms+335ms
which is10 times
data lossI know its performing some kind of Garbage Collection but my question is why does it frequently comes in the logcat.
Thanks for any kind of help!!!!!!
-
G M Ramesh over 11 yearsI have edited my question, please look at that and give me a solution
-
G M Ramesh over 11 yearsI have edited my question, please look at that and give me a solution
-
Mohamed_AbdAllah over 11 yearsYou still need to minimize object definition to minimize GC. You need to show us the code that plays the audio to assist you in finding these objects.
-
Kung Foo over 11 yearsYou really need to check for optimizations to your code. Sounds like your code requires too much GC's.