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
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?