Garbage collection notification?

前端 未结 11 608
北海茫月
北海茫月 2020-12-30 19:31

I\'d like to register a callback with the JVM so I know when garbage collection is happening. Is there any way to do this?

EDIT: I want to do this so I can log out

11条回答
  •  旧巷少年郎
    2020-12-30 20:15

    I know this is very late but I hope it might help someone someday.

    You can receive such events this by using the using the library that i am developing called gcRadar. It provides information about exactly when an object was garbage collected.

    Any suggestions for improvements in the library are welcome.

提交回复
热议问题