How to determine cause of class loading

Doug Simon doug.simon at oracle.com
Thu Dec 14 13:20:14 UTC 2017


Quite often I find myself wanting to know why a given class is loaded. That is, I want to see a stack trace. As far as I can tell, there is no support for this in HotSpot which is why we hacked in support for a -XX:+TraceClassLoadingStack to graal-jvmci-8[1]. Is there a good reason a similar flag should not be added to main line HotSpot?

-Doug

[1] https://github.com/graalvm/graal-jvmci-8/commit/25de3259d10b8606e318ceecbdf0195d3b1f196f


More information about the hotspot-dev mailing list