Find references to the object in runtime

后端 未结 6 798
梦谈多话
梦谈多话 2020-12-15 18:02

I have an object, which lives forever. I am deleteing all references I can see, to it after using it, but it still not collected. Its life cycle is pretty sophisticated so I

6条回答
  •  庸人自扰
    2020-12-15 18:23

    It is not collected because you haven't removed all references to it. The GC will only mark objects for collection if they have no roots in the application.

    What means are you using to check up on the GC to see if it has collected your object?

提交回复
热议问题