You cannot enable class sharing without considering how
to deploy it sensibly for your application. This section looks at
some of the important issues to consider.
Cache naming
If multiple users will be using an application that is
sharing classes or multiple applications are sharing the same cache,
knowing how to name caches appropriately is important. The ultimate
goal is to have the smallest number of caches possible, while maintaining
secure access to the class data and allowing as many applications
and users as possible to share the same classes.
Cache access
A JVM can access a shared class cache with either read-write
or read-only access. Read-write access is the default and gives all
users equal rights to update the cache. Use the -Xshareclasses:readonly option
for read-only access.
Cache housekeeping
Unused caches on a system waste resources that might be
used by another application. Ensuring that caches are sensibly managed
is important.
Cache performance
Shared classes use optimizations to maintain performance
under most circumstances. However, there are configurable factors
that can affect shared classes performance.