Android : Android Multithreading - WaitForGcToComplete after sending app to background

on Wednesday, October 29, 2014


I'm using Android L for some heavily multi-threaded operations, using multiple ThreadPoolExecutors to run queues of AsyncTasks.


When my app goes to the background, I start seeing numerous logs for...


I/art: WaitForGcToComplete blocked for ##.#####ms for cause XXXXX


...with an occasional...


I/art: No such thread id for suspend: ###.


It seems clear that something is going on that's making GC take longer than expected. The log gets generated by art/runtime/gc/heap.cc deep in the AOSP. The secondary log message indicates it's probably related to my thread pools. What isn't clear is why this is only happening (i.e. getting logged) when the app is sent to the background.


I haven't seen any crashes yet due to this, but I have a lot more testing to go through. Has anyone out there run into issues coinciding with these logs?


0 comments:

Post a Comment