Thread objects not garbage collected after being finished

后端 未结 4 1810
遥遥无期
遥遥无期 2021-02-08 13:28

I noticed that my application is leaking memory. This can be seen in DDMS, and I managed to get a OutOfMemoryError.

I found the source of the leak. One of the activitie

4条回答
  •  抹茶落季
    2021-02-08 14:20

    I kept investigating and what I've found is really suprising. It seems there is no real memory leak. It happens only when app is in debugging mode in DDMS.

    DDMS seems to somehow hold references to those finished treads, preventing them from being GC-ed. When i disconnect the phone and connect again, I can see that all "leaked" resources have been released.

    It looks like a bug in DDMS.

提交回复
热议问题