Multiple threads being added to application every run through if the app is not shut down

154 views Asked by At

Whilst running my android app the thread count is rising 20 threads per run through. I have google maps and display a map on the first activity then it is, choose destination run the route then finish and return to the map screen. the threads being added seem to be in the main googlemapsapi. Does anyone know why this should be? do I need to kill my map implementation before restarting what am I doing wrong. I cannot dump all of my code into this as it's too much, it is more of a general behaviour question and if anyone can help understand what causing this increase in thread count as it eventually slows my app down.

Every run through adds these threads and the previous remain also so the thread count rises by 20.

onCreate: Thread Check: 95: Thread[androidmapsapi-ulcs-1,5,main]
onCreate: Thread Check: 96: Thread[GLThread 40470,5,main]
onCreate: Thread Check: 97: Thread[androidmapsapi-ula-1,5,main]
onCreate: Thread Check: 98: Thread[pool-25-thread-2,5,main]
onCreate: Thread Check: 99: Thread[pool-23-thread-1,5,main]
onCreate: Thread Check: 100: Thread[androidmapsapi-gmi-1,5,main]
onCreate: Thread Check: 101: Thread[androidmapsapi-gmi-2,5,main]
onCreate: Thread Check: 102: Thread[androidmapsapi-gmi-3,5,main]
onCreate: Thread Check: 103: Thread[androidmapsapi-gmi-4,5,main]
onCreate: Thread Check: 104: Thread[androidmapsapi-gmi-5,5,main]
onCreate: Thread Check: 105: Thread[androidmapsapi-gmi-6,5,main]
onCreate: Thread Check: 106: Thread[androidmapsapi-gmi-7,5,main]
onCreate: Thread Check: 107: Thread[androidmapsapi-gmi-8,5,main]
onCreate: Thread Check: 108: Thread[androidmapsapi-gmi-9,5,main]
onCreate: Thread Check: 109: Thread[androidmapsapi-gmi-10,5,main]
onCreate: Thread Check: 110: Thread[pool-34-thread-1,5,main]
onCreate: Thread Check: 111: Thread[pool-34-thread-2,5,main]
onCreate: Thread Check: 114: Thread[pool-38-thread-1,5,main]
onCreate: Thread Check: 115: Thread[pool-44-thread-1,5,main]

I understand I will have to look into the Threads using the thread pool and see why these are not being shutdown, however the androidmapsapi and the GLThread I do not understand why these are recreated?

0

There are 0 answers