http://docs.oracle.com/javase/6/docs/technotes/guides/vm/class-data-sharing.html
Class Data Sharing
Overview
Class data sharing (CDS) is a new feature in J2SE 5.0 intended to reduce the startup time for Java programming language applications, in particular smaller applications, as well as reduce footprint. When the JRE is installed on 32-bit platforms using the Sun provided installer, the installer loads a set of classes from the system jar file into a private internal representation, and dumps that representation to a file, called a "shared archive". Class data sharing is not supported in Microsoft Windows 95/98/ME. If the Sun JRE installer is not being used, this can be done manually, as explained below. During subsequent JVM invocations, the shared archive is memory-mapped in, saving the cost of loading those classes and allowing much of the JVM's metadata for these classes to be shared among multiple JVM processes.
In J2SE 5.0, class data sharing is supported only with the Java HotSpot Client VM, and only with the serial garbage collector.
The primary motivation for including CDS in the 5.0 release is the decrease in startup time it provides. CDS produces better results for smaller applications because it eliminates a fixed cost: that of loading certain core classes. The smaller the application relative to the number of core classes it uses, the larger the saved fraction of startup time.
The footprint cost of new JVM instances has been reduced in two ways. First, a portion of the shared archive, currently between five and six megabytes, is mapped read-only and therefore shared among multiple JVM processes. Previously this data was replicated in each JVM instance. Second, since the shared archive contains class data in the form in which the Java Hotspot VM uses it, the memory which would otherwise be required to access the original class information in rt.jar
is not needed. These savings allow more applications to be run concurrently on the same machine. On Microsoft Windows, the footprint of a process, as measured by various tools, may appear to increase, because a larger number of pages are being mapped in to the process' address space. This is offset by the reduction in the amount of memory (inside Microsoft Windows) which is needed to hold portions on rt.jar
. Reducing footprint remains a high priority.
Regenerating the Shared Archive
Under some circumstances the system administrator may need to manually regenerate the shared archive. This is typically only necessary on Solaris if the Java SE packages were installed over the network to a machine of a different architecture than that performing the installation. Regardless, these regeneration instructions apply to all supported platforms.
The shared archive file is colocated with the shared library for the JVM. On Unix platforms, it is stored in jre/lib/[arch]/client/classes.jsa
and on Microsoft Windows platforms injre/bin/client/classes.jsa
. If this file exists, it must be manually removed before regeneration.
To regenerate the archive, log in as the administrator; in networked situations, log on to a machine of the same architecture as the J2SE installation and ensure that you have permission to write to the installation directory. Then execute the command
java -Xshare:dump
Diagnostic information will be printed as the archive is generated.
Manually Controlling Class Data Sharing
The class data sharing feature is automatically enabled when conditions allow it to be used. The following command line options are present primarily for diagnostic and debugging purposes and may change or be removed in future releases.
-Xshare:off
-Xshare:on
-Xshare:auto
相关推荐
It describes in particular the mechanisms of synchronization (cooperative and competitive) and sharing of data (internal class, static variables) between threads in Java. He then discusses the use of...
java poi event user mode prevent from loading all the excel data into memory, has high performance and fix all the 2003 excel file. Here is the core abstract class. To do more detailed logic handling,...
针对 64 位平台,使用默认类列表增强 JDK 构建过程以生成类数据共享(class data-sharing,CDS)档。 Abortable Mixed Collections for G1 可中止的 G1 Mixed GC 如果 G1 Mixed GC 存在超出暂停目标的可能性,则...
This release contains improvements like Local-Variable Type Inference, Parallel Full GC, Application Class-Data Sharing. Oracle strongly recommends that all Java SE users upgrade to this release. ...
This release contains improvements like Local-Variable Type Inference, Parallel Full GC, Application Class-Data Sharing. Oracle strongly recommends that all Java SE users upgrade to this release. ...
This release contains improvements like Local-Variable Type Inference, Parallel Full GC, Application Class-Data Sharing. Oracle strongly recommends that all Java SE users upgrade to this release. ...
Java SE5 and SE6 .................. 2 Java SE6 ......................................... 2 The 4th edition........................ 2 Changes .......................................... 3 Note on the ...
CJBTaskBarApplet.zip A framework for system tray applets(32KB)<END><br>99,systemtray.zip A class for adding icons to the system tray(120KB)<END><br>100,CGFileType.zip Registry entries and MFC...
PEP 412: Key-Sharing Dictionary PEP 362: Function Signature Object PEP 421: Adding sys.implementation SimpleNamespace Using importlib as the Implementation of Import New APIs Visible Changes ...
Sharing Data Among Web Applications Chapter 2. Controlling Web Application Behavior with web.xml Section 2.1. Purpose of the Deployment Descriptor Section 2.2. Defining the Header and the Root ...
The Java EE 5Tutorial For Sun Java System Application Server 9.1 Contents Preface .........................................................................................................................
3.3. Java 8 (as well as 6 and 7) ............................................................................... 17 3.4. Java EE 6 and 7 ..................................................................
3.3. Java 8 (as well as 6 and 7) ............................................................................... 17 3.4. Java EE 6 and 7 ..................................................................
ORACLE OSB开发指南,英文版。 目录: Part I IDE Help for Oracle Service Bus 1 Introduction to Oracle Service Bus 2 Tasks Working with Projects, Folders, Resources, and Configurations .....................