As J2SE 5.0 release, Java
The TM HotSpot virtual machine also updates. New changes include: class data sharing, garbage collection, server-level machine detection, thread priority change, fatal error handling, high-precision timing support, etc.
Next, let's take a look at it.
[Class data sharing]
In the past Java version, everyone will have a micro-word on the startup speed of the Java application, so Sun has improved in this regard in the release of new JRE. This is the class data sharing.
Simply put, class data sharing is automatically installed at JRE installation, or manually, the core Java class is packaged and converted into the format of virtual machine recognition, and this section will take this paragraph when the virtual machine is started next time. The data is mapped directly to memory without the process of loading, and because this data is static, it can be shared by all virtual machine processes. Therefore, after using class data sharing, the Java program starts faster.
The class data sharing does not support Windows 95/98 / ME according to the documentation provided by Sun, and can only be used for Client VM (customer-type virtual machine) and must use a serial garbage collector. Specially mentioned in the document: In the Windows environment, the increase in the amount of memory occupied by Java programs is actually a mapping, and the total memory use is reduced.
Here are some related command lines:
Java -xshare: DUMP manual generation class data sharing
Java -xshare: OFF Close Sharing
Java -XShare: ON opens sharing
Java -xshare: Auto automatically determines sharing (default)
More details, reference
Here.
[Garbage collector]
J2SE 5.0 Optimized adjustments to the garbage collection performance of virtual machines running on the server-level machine, generally including the default use parallel GC, new default pile maximum and minimum, new Time-Limit and Space-Limit parameters, etc.
These changes roughly only for a very good machine, there is no time to study, more information reference
Here.
[Server-level machine detection]
This mechanism is used to automatically determine if the machine has the characteristics of the server machine when starting the Java program, and automatically selects the use of the appropriate virtual machine. It should be noted that in the release of J2SE 5.0, two versions of virtual machines are included, a Client VM, a Server VM, which is used for different situations.
Determine if a machine is a server level, there is a standard, that is, there is two or more CPUs, and whether there is 2G or more memory. Unfortunately, on all 32-bit Windows machines, the default is only Client VM, and on the Windows machine in the AMD64 bit, there is only one option, that is, the Server VM. So it is basically concluded that the Windows platform does not have this detection function.
More detailed information about server-level machine detection, reference
Here.
[Thread priority change]
If I don't understand the fault, these changes are only reflected on the SUN Solaris operating system. Interested friends to see
Here.
[Fatal error handling]
The fatal error reporting machine in J2SE 5.0 is enhanced: improved debugging information output and reliability.
[High-precision timing support]
A new system.nanotime () method is introduced in J2SE 5.0, but the specific accuracy is related to the platform.
Basically, in addition to the first class data sharing, I didn't find something too attracted to me.