IBM User Guide for Java V7 on Windows > Troubleshooting and support > Using diagnostic tools > Shared classes diagnostic data
Dealing with runtime bytecode modification
Modifying bytecode at run time is an increasingly popular way to engineer required function into classes. Sharing modified bytecode improves startup time, especially when the modification being used is expensive. You can safely cache modified bytecode and share it between JVMs, but there are many potential problems because of the added complexity. It is important to understand the features described in this section to avoid any potential problems.
This section contains a brief summary of the tools that can help you to share modified bytecode.
- Potential problems with runtime bytecode modification
The sharing of modified bytecode can cause potential problems.- Modification contexts
A modification context creates a private area in the cache for a given context, so that multiple copies or versions of the same class from the same location can be stored using different modification contexts. You choose the name for a context, but it must be consistent with other JVMs using the same modifications.- SharedClassHelper partitions
Modification contexts cause all classes loaded by a particular JVM to be stored in a separate cache area. If you need a more granular approach, the SharedClassHelper API can store individual classes under "partitions".- Using the JVMTI ClassFileLoadHook with cached classes
The -Xshareclasses:enableBCI suboption improves startup performance without using a modification context, when using JVMTI class modification. This suboption allows classes loaded from the shared cache to be modified using a JVMTI ClassFileLoadHook, or a java.lang.instrument agent, and prevents modified classes being stored in the shared classes cache.- JVMTI redefinition and retransformation of classes
Redefined classes are never stored in the cache. Retransformed classes are not stored in the cache by default, but caching can be enabled using the -Xshareclasses:cacheRetransformed option.- Further considerations for runtime bytecode modification
There are a number of additional items that you need to be aware of when using the cache with runtime bytecode modification.
Parent: Shared classes diagnostic data
Error 404 - Not Found Error 404 - Not Found
The document you are looking for may have been removed or re-named. Please contact the web site owner for further assistance.