Currently, the Cleaner class is initialized in ReferenceHandler.run(). The comment there says:
202 // pre-load and initialize Cleaner class so that we don't
203 // get into trouble later in the run loop if there's
204 // memory shortage while loading/initializing it lazily.
However, doing it at the start of run() still relies on platform-specific thread scheduling to decide when the initialization happens. We are seeing strange failures on Windows because of this. See JDK-8329357.
Moving the initialization of Cleaner to startReferenceHandlerThread() should make these kinds of startup failures more deterministic.
202 // pre-load and initialize Cleaner class so that we don't
203 // get into trouble later in the run loop if there's
204 // memory shortage while loading/initializing it lazily.
However, doing it at the start of run() still relies on platform-specific thread scheduling to decide when the initialization happens. We are seeing strange failures on Windows because of this. See JDK-8329357.
Moving the initialization of Cleaner to startReferenceHandlerThread() should make these kinds of startup failures more deterministic.
- relates to
-
JDK-8329357 JavaFuzzer execution failed with "Exception in thread "Reference Handler" java.lang.NoClassDefFoundError: jdk/internal/ref/Cleaner"
- Open