The printStats utility prints summary
information about the specified cache to the standard error output.
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:
baseAddress = 0x53133000
endAddress = 0x590E0000
allocPtr = 0x548B2F88
cache size = 100662924
free bytes = 63032784
ROMClass bytes = 32320692
AOT bytes = 4277036
Data bytes = 339667
Metadata bytes = 692745
Metadata % used = 1%
# ROMClasses = 9576
# AOT Methods = 3136
# Classpaths = 5
# URLs = 111
# Tokens = 0
# Stale classes = 0
% Stale classes = 0%
Cache is 37% full
- baseAddress and endAddress
- Give the boundary addresses of the shared memory area containing
the classes.
- allocPtr
- Is 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.
- ROMClass bytes
- Is the number of bytes of class data in the cache.
- AOT bytes
- Is the number of bytes of Ahead Of Time (AOT) compiled code in
the cache.
- Data bytes
- Is the number of bytes of non-class data stored by the JVM.
- Metadata bytes
- Is the number of bytes of data stored to describe the cached classes.
- Metadata % used
- Shows the proportion of metadata bytes to class bytes; this proportion
indicates how efficiently cache space is being used.
- # ROMClasses
- Indicates 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
- Indicates 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 classloaders, including the bootstrap and
application classloaders, 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.
- # Stale classes
- Are classes that have been marked as "potentially stale" by the
cache code, because of an operating system update. See Understanding dynamic updates.
- % Stale classes
- Is an indication of the proportion of classes in the cache that
have become stale.