How do I keep track when class is loaded and destroyed in jvm? Is there any callback method that is exposed by the jvm?
You can track class's creation in static constructor. And you cannot track it's destruction as far as I'm concerned. Classes are only unloaded when gc collects the classloader which was used to load the classes.
You might also be interested in reading this: another question on classloaders at StackOverflow