Question regarding JVM crashes in GC

Alan Bateman Alan.Bateman at oracle.com
Tue Apr 11 10:19:30 UTC 2017


On 11/04/2017 09:07, Michael Rasmussen wrote:

> :
> Yeah, based on information from here we are working on a solution
> right now, trying to defer loading as many of our classes as possible
> until after VMStart.
> I feel confident we'll get it to work, without crashing the JVM :D
>
I don't know if we have the can_generate_early_vmstart capability 
enabled. If you do then the VMStart event is posted as early as possible 
and comes with a warnings in the JVM TI spec:

"The VM is capable of executing bytecode but it may not have initialized 
to the point where it can load classes in modules other than java.base, 
or even arbitrary classes in java.base. Agents that do load-time 
instrumentation in this phase must take great care when instrumenting 
code that potentially executes in this phase. Extreme care should also 
be taken with JNI FindClass as it may not be possible to load classes 
and attempts to do so may result in unpredictable behavior, maybe even 
stability issues on some VM implementations."

The concerns in this about stability and "unpredictable behavior" apply 
to JDK 8 and older releases too of course, early startup has always been 
delicate.

I realize your agent wants to do load time transformation of many core 
classes but it's always required great care. Many JVM TI agents won't be 
too concerned with this as they will be content to wait until the VM is 
full initialized and the VMInit event is posted.

-Alan.


More information about the hotspot-dev mailing list