0

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?

user15348067
  • 43
  • 1
  • 5
  • That is simply the thread name, it doesn't relate directly to the pool size. The naming will come, most likely when generated using a `ThreadFactory`. – Mark May 08 '21 at 15:51
  • @MarkKeen Thanks Mark I will look into those threads to try to understand the origin hopefully I can sort those out, but it is really the androdimapsapi-gmi threads I am really unsure about and why they get recreated or started are they I assume to do with displaying my google map so how can I stop them being duplicated every time I open the map on my main activity? – user15348067 May 08 '21 at 16:10

0 Answers0