Why does it always shows GC_CONCURRENT FREED and GC_CONCURRENT ALLOCATE in Android Logcat while running a app?
android, android-logcat, garbage-collection, memory-leaks, memory-management
Solution
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.).
Problem
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 every `40ms` so here it paused for `9ms+335ms` which is `10 times` data loss I 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!!!!!!