JDK-8059346 : Single class loader is used to load compiled bytecode
  • Type: Bug
  • Component: core-libs
  • Sub-Component: jdk.nashorn
  • Affected Version: 8u40,9
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2014-09-29
  • Updated: 2015-06-04
  • Resolved: 2014-10-02
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8 JDK 9
8u40Fixed 9 b34Fixed
Description
With optimistic types, compiled versions which are already retired are still kept around by Context$ContextCodeInstaller.

Running Box2D on recent jdk9 build w/ optimistic types: 
 * turned ON: 20k LinkerCallSite, 1141 classes loaded by ScriptLoader
 * turned OFF: 10k LinkerCallSite, 352 classes loaded by ScriptLoader
Comments
This can be verified by running any octane benchmark (e.g. box2d) and enabling -XX:+TraceClassUnloading. With this fix applied, you should see a bunch of messages saying [Unloading class jdk.nashorn.internal.scripts.Script$Recompilation$ ... ] meaning that obsoleted code versions are being unloaded. Box2d unloads 617 such classes. Without this fix applied, no jdk.nashorn.internal.scripts.Script$Recompilation will be observed as being unloaded.
02-10-2014