Garbage collection notification?

前端 未结 11 631
北海茫月
北海茫月 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:07

    There is no standard way for your own program to get information from the JVM about garbage collection. Any such API is vendor specific.

    Why is the facility you found insufficient?

提交回复
热议问题