printStats utility

The printStats utility prints summary information about the specified cache to the standard error output. You can optionally specify one or more types of cache content, such as AOT data or tokens, to see more detailed information about that type of content. To see detailed information about all the types of content in the cache, use the printAllStats utility instead.

The printStats utility is a suboption of -Xshareclasses. You can specify a cache name using the name=<name> parameter. printStats is a cache utility, so the JVM reports the information about the specified cache and then exits.

The following output shows example results after running the printStats utility without a parameter, to generate summary data only:
Cache created with:
        -Xnolinenumbers                      = false
        BCI Enabled                          = true
        Restrict Classpaths                  = true
        Feature                              = cr

Cache contains only classes with line numbers

base address                         = 0x00007F44FC8EA000
end address                          = 0x00007F44FD8CE000
allocation pointer                   = 0x00007F44FCA1E650

cache size                           = 16776608
Start of changes for service refresh 5softmx bytes                         = 8388608End of changes for service refresh 5
free bytes                           = 5638158
ROMClass bytes                       = 1263184
AOT bytes                            = 20164
Reserved space for AOT bytes         = -1
Maximum space for AOT bytes          = -1
JIT data bytes                       = 1120
Reserved space for JIT data bytes    = -1
Maximum space for JIT data bytes     = -1
Zip cache bytes                      = 1149512
Data bytes                           = 114080
Metadata bytes                       = 22348
Metadata % used                      = 0%
Class debug area size                = 1331200
Class debug area used bytes          = 179434
Class debug area % used              = 13%

# ROMClasses                         = 433
# AOT Methods                        = 12
# Classpaths                         = 1
# URLs                               = 0
# Tokens                             = 0
# Zip caches                         = 21
# Stale classes                      = 0
% Stale classes                      = 0%

Start of changes for service refresh 5Cache is 32% soft fullEnd of changes for service refresh 5

Cache is accessible to current user = true

In the example output, -Xnolinenumbers = false means the cache was created without the -Xnolinenumbers option being specified.

BCI Enabled = true indicates that the cache was created with the -Xshareclasses:enableBCI suboption. This suboption is the default.

Restrict Classpaths = true indicates that the cache was created with the -Xshareclasses:restrictClasspaths suboption.

Start of changes for service refresh 2 fix pack 10Feature = cr indicates that the cache is a 64-bit compressed references cache. For more information, see Creating, populating, monitoring, and deleting a cache.End of changes for service refresh 2 fix pack 10

One of the following messages is displayed to indicate the line number status of classes in the shared cache:
Cache contains only classes with line numbers
JVM line number processing was enabled (the -Xnolinenumbers option was not specified) for all the classes that were put in this shared cache. All classes in the cache contain line numbers if the original classes contained line number data.
Cache contains only classes without line numbers
JVM line number processing was disabled (the -Xnolinenumbers option was specified) for all the classes that were put in this shared cache, so none of the classes contain line numbers.
Cache contains classes with line numbers and classes without line numbers
JVM line number processing was enabled for some classes and disabled for others (the -Xnolinenumbers option was specified when some of the classes were added to the cache).
The following summary data is displayed:
baseAddress and endAddress
The boundary addresses of the shared memory area containing the classes.
allocPtr
The address where ROMClass data is currently being allocated in the cache.
cache size and free bytes
cache size shows the total size of the shared memory area in bytes, and free bytes shows the free bytes remaining.
Start of changes for service refresh 5softmx bytesEnd of changes for service refresh 5
Start of changes for service refresh 5The value of the soft maximum size for the cache. For more information, see -Xscmx.End of changes for service refresh 5
ROMClass bytes
The number of bytes of class data in the cache.
AOT bytes
The number of bytes of Ahead Of Time (AOT) compiled code in the cache.
Reserved space for AOT bytes
The number of bytes reserved for AOT compiled code in the cache.
Maximum space for AOT bytes
The maximum number of bytes of AOT compiled code that can be stored in the cache.
JIT data bytes
The number of bytes of JIT-related data stored in the cache.
Reserved space for JIT data bytes
The number of bytes reserved for JIT-related data in the cache.
Maximum space for JIT data bytes
The maximum number of bytes of JIT-related data that can be stored in the cache.
Zip cache bytes
The number of zip entry cache bytes stored in the cache.
Data bytes
The number of bytes of non-class data stored by the JVM.
Metadata bytes
The number of bytes of data stored to describe the cached classes.
Metadata % used
The proportion of metadata bytes to class bytes; this proportion indicates how efficiently cache space is being used. The value shown does consider the Class debug area size.
Class debug area size
The size in bytes of the Class Debug Area. This area is reserved to store LineNumberTable and LocalVariableTable class attribute information.
Class debug area bytes used
The size in bytes of the Class Debug Area that contains data.
Class debug area % used
The percentage of the Class Debug Area that contains data.
# ROMClasses
The number of classes in the cache. The cache stores ROMClasses (the class data itself, which is read-only) and it also stores information about the location from which the classes were loaded. This information is stored in different ways, depending on the Java™ SharedClassHelper API used to store the classes. For more information, see Using the Java Helper API.
# AOT methods
Optionally, ROMClass methods can be compiled and the AOT code stored in the cache. The # AOT methods information shows the total number of methods in the cache that have AOT code compiled for them. This number includes AOT code for stale classes.
# Classpaths, URLs, and Tokens
The number of classpaths, URLs, and tokens in the cache. Classes stored from a SharedClassURLClasspathHelper are stored with a Classpath. Classes stored using a SharedClassURLHelper are stored with a URL. Classes stored using a SharedClassTokenHelper are stored with a Token. Most class loaders, including the bootstrap and application class loaders, use a SharedClassURLClasspathHelper. The result is that it is most common to see Classpaths in the cache.

The number of Classpaths, URLs, and Tokens stored is determined by a number of factors. For example, every time an element of a Classpath is updated, such as when a .jar file is rebuilt, a new Classpath is added to the cache. Additionally, if partitions or modification contexts are used, they are associated with the Classpath, URL, or Token. A Classpath, URL, or Token is stored for each unique combination of partition and modification context. For more information about partitions, see SharedClassHelper partitions. For more information about modification contexts, see Modification contexts.

# Zip caches
The number of .zip files that have entry caches stored in the shared cache.
# Stale classes
The number of classes that have been marked as "potentially stale" by the cache code, because of an operating system update. See Understanding dynamic updates.
% Stale classes
The percentage of classes in the cache that have become stale.
Cache is XXX% full
The percentage of the cache that is currently used.Start of changes for service refresh 5 This line is displayed only if the soft maximum size is not set.End of changes for service refresh 5 The calculation for this value is as follows:
For releases before service refresh 5
% Full = (('Cache Size' - 'Debug Area Size' - 'Free Bytes') * 100) / 
('Cache Size' - 'Debug Area Size')
Start of changes for service refresh 5For service refresh 5 and laterEnd of changes for service refresh 5
Start of changes for service refresh 5
% Full = (('Cache Size' - 'Free Bytes') * 100) / ('Cache
    Size')
End of changes for service refresh 5
Start of changes for service refresh 5Cache is XXX% soft fullEnd of changes for service refresh 5
Start of changes for service refresh 5The percentage of the soft maximum size that is currently used. This line is displayed only if the soft maximum size is set. The free bytes in the cache statistics means the free bytes within the soft maximum limit. The calculation for this value is as follows:
% soft Full = (('Soft max bytes' - 'Free Bytes') * 100) / ('Soft max
    bytes')
For more information about the soft maximum size, see -Xscmx.End of changes for service refresh 5
Cache is accessible to current user
Whether the current user can access the cache.

Generating more detailed information

You can use a parameter to specify one or more types of cache content. The printStats utility then provides more detailed information about that type of content, in addition to the summary data described previously. The detailed output is similar to the output from the printAllStats utility. For more information about the different types of cache content and the printAllStats utility, see printAllStats utility.

If you want to specify more than one type of cache content, use the plus symbol (+) to separate the values:
printStats[=type_1[+type_2][...]]
For example, use printStats=classpath to see a list of class paths that are stored in the shared cache, or printStats=romclass+url to see information about ROMClasses and URLs.
The following data types are valid. The values are not case sensitive:
Help
Prints a list of valid data types.
All
Prints information about all the following data types in the shared cache. This output is equivalent to the output produced by the printAllStats utility.
Classpath
Lists the class paths that are stored in the shared cache.
URL
Lists the URLs that are stored in the shared cache.
Token
Lists the tokens that are stored in the shared cache.
ROMClass
Prints information about the ROMClasses that are stored in the shared cache. This parameter does not print information about ROMMethods in ROMClasses.
ROMMethod
Prints ROMClasses and the ROMMethods in them.
AOT
Prints information about AOT compiled code in the shared cache.
JITprofile
Prints information about JIT data in the shared cache.
JIThint
Prints information about JIT data in the shared cache.
ZipCache
Prints information about zip entry caches that are stored in the shared cache.
Start of changes for service refresh 5StaleEnd of changes for service refresh 5
Start of changes for service refresh 5Prints the stale entries that are in the shared cache. For more information about stale classes, see Understanding dynamic updates.End of changes for service refresh 5