-
CSR
-
Resolution: Approved
-
P3
-
None
-
None
-
source, binary
-
low
-
The JVM_InitProperties function is an implementation specific entry point defined in jvm.h. The function is used solely by System initialization. There is no change in the behavior of the initialized properties.
-
Other
-
Implementation
Summary
The initialization of the system properties in System.initPhase1 is inefficient due to the number of upcalls to Properties set/get/remove methods. Replacing the current JVM_initProperties function with JVM_getProperties removes the cost of the upcalls.
Problem
The code that initializes system properties, which is partly in the libraries (src/share/native/java/lang/System.c and the various java_props*.[ch] files) and partly in HotSpot, does (almost) one JNI upcall for each system property defined. The JVM_initProperties function builds a dependency into native code on the System Properties instance and the initialization is split between java and native code.
Solution
The upcalls can be replaced by assembling the properties into a single String array returned from a single JNI call. The array can be processed to resolve defaults and overrides in java code to create the Properties instance. The native code no longer depends on the implementation of Properties.
Specification
The JVM_InitProperties function is removed from jvm.h and its implementation.
The JVM_GetProperties function is added to jvm.h to return the JVM supplied properties in a String array with alternating property names and values.
- csr of
-
JDK-4947890 Minimize JNI upcalls in system-properties initialization
- Resolved