[J2SE 5.0 Topics] [3] Virtual machines

Source: Internet
Author: User
Tags error handling garbage collection memory usage thread versions client
J2SE with the release of J2SE 5.0, JAVATM hotspot virtual machines are also updated. New changes include: class data sharing, garbage collection, server-level machine detection, thread-priority changes, fatal error handling, high-precision timing support, and more.





Next we all come together to see one by one.





[class data sharing]





probably in previous Java versions, there was a criticism that Java applications started to start, and sun was making improvements in the release of the new JRE. This is class data sharing.





in simple terms, class data sharing is automatically installed on the JRE, or at any time after the installation of manual, the core of Java classes packaged and converted into a virtual machine recognition format, the next time the virtual machine to start, it will be directly mapped to the data in memory, and do not need to walk the loading process, And because this piece of data is static, it can be shared by all virtual machine processes. So, when you use class data sharing, Java programs start faster.





based on Sun-provided documentation, class data sharing does not support Windows 95/98/me and can only be used for client VMS (client-side virtual machines) and must use serial garbage collectors. It is also mentioned in the document that in the Windows environment, the amount of memory consumed by the Java program is displayed, which is the reason for the mapping, and the total memory usage is actually reduced.





The following are some related command lines:





java-xshare:dump manually generate class data sharing


Java-xshare:off turn off sharing


Java-xshare:on Open Sharing


Java-xshare:auto automatically determines the share (default)





more detailed information, refer to here.





[garbage collector]





J2SE 5.0 optimizes the garbage collection performance of virtual machines running on server-level machines, roughly including the default use of parallel GC, new default heap maximum and minimum values, new Time-limit and Space-limit parameters, and so on.





These changes are generally only for the well configured machines, there is no time to study carefully, detailed information reference here.





[Server-level machine detection]





This mechanism is used to automatically determine whether a machine has the characteristics of a server machine when starting a Java program, and automatically chooses to use the appropriate version of the virtual machine. It should be explained that in the release of J2SE 5.0, two versions of the virtual machines, a client VM, and a server VM are included, which are used for different scenarios.





to determine whether a machine is a server-level, there is a standard, that is, whether two or more than two CPUs, and whether there is more than 2G of memory. Unfortunately, on all 32-bit Windows machines, the default is only the client VM, and on the AMD64 bit of the Windows machine, there is also only one option, that is the server VM. So it is almost certain that the Windows platform does not have this detection capability.





For more detailed information about server-level machine detection, refer to here.





[Thread-priority change]





If I'm not mistaken, these changes are only reflected in Sun's Solaris operating system. Interested friends to see here.





[fatal error handling]




The fatal error reporting mechanism in
J2SE 5.0 is enhanced: Improved debugging information output and reliability.





[High precision timing support]




The new System.nanotime () method is introduced in
J2SE 5.0, but the specific precision is platform-dependent.








basically like this, I did not find anything too appealing to me except for the first class data sharing.











Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.