How to tell which thread(s) are producing all the garbage?
- by Brad Hein
I have an app with about 15 threads. Most do mundane tasks and sleep most of their lives. Others collect information and cache it in hashmaps. The hashmaps grow to a moderate size and level out. The number of keys and size of value remains constant, but the contents of the values changes (at 33 keys per second average).
When I start my app, I notice the garbage collection interval goes from minutes to once per second, and the amount of garbage is 700k+ each time.
In fact as I was writing this, it caused my phone to reboot with an error "Referencetable Overflow".
Here's my question: Are there any tricks to identifying which threads are producing the garbage, or even finding out more about what garbage they are producing?