18

I'm developing an offline mapView using OSMdroid Library. My tilesource loads the tiles but renders quit steadily. But the fact is in my log messages, I keep getting this error:

GC_FOR_ALLOC freed 6346K, 7% free , paused 143ms, total 143ms

I'm not sure how to debug this? Any ideas, do I have any memory leaks?

gruszczy
  • 40,948
  • 31
  • 128
  • 181
zIronManBox
  • 4,967
  • 6
  • 19
  • 35
  • 2
    See also http://stackoverflow.com/questions/2298208/how-to-discover-memory-usage-of-my-application-in-android and http://stackoverflow.com/questions/20517908/why-so-many-gc-for-alloc-in-a-simple-app/20523690#20523690 – fadden May 07 '14 at 05:05

1 Answers1

38

This is not an error, but an information that Garbage collector has run.

If you are seeing a lot of those, it might mean that you are making many allocations or have little memory. You should try to improve your program's memory performance.

There is a good source information about investigating RAM consumption in Android:

https://developer.android.com/tools/debugging/debugging-memory.html

There is also a document about general strategies for managing your memory consumption in Android:

http://developer.android.com/training/articles/memory.html

gruszczy
  • 40,948
  • 31
  • 128
  • 181
  • 1
    nice explanation for new commers ;) – Maveňツ May 07 '14 at 04:58
  • 1
    The second document was very useful&enlightening to me. – gruszczy May 07 '14 at 04:59
  • @gruszczy I'd one more msg popping, `05-12 11:51:06.581: I/Choreographer(6837): Skipped 392 frames! The application may be doing too much work on its main thread.` – zIronManBox May 12 '14 at 06:22
  • 1
    Well, you are doing some heavy processing in your Activity thread. You need profile your application and probably move some code to a separate thread or to a service. – gruszczy May 12 '14 at 17:00
  • @gruszczy how do I profile my application? I've heard about DDMS method profiling, but I've not understood correctly. Any tips to understand the same? – zIronManBox May 14 '14 at 11:37