As this is a JAVA (JVM) specific issue, it needs to be addressed on the JAVA end. JAVA 7 has implemented a solution for this issue. However, since most of our existing user base still requires the support for JAVA 1.5 for their agent and monitored application, we cannot adopt this solution at present. We have notified our development team to consider the solution for future releases and they are evaluating it.
At the meantime, we have implemented a workaround for this issue from the Introscope agent perspective, called classload caching. It would be a onetime activity to generate a list of .cls files in the monitored environment where the deadlock is happening. The content of the .cls file may differ from application to application and also depends on the agent extensions. It is then followed by caching these classes for future class loading to prevent unnecessary deadlock.
Below are the steps to implement the workaround:
1. In the IntroscopeAgent.profile, set introscope.agent.extensions.eagerloader=regenerate
- Setting this properties to regenerate should regenerate the list of classes that need to be loaded by that particular class loader of that extension jar and update the list of classes within that JAR a bunch of files with extension “.cls” in “AGENT_HOME/core/ext” folder. Each of the .cls contains set of classes that can be preloaded and cached. For each of the extension, a separate .cls file is created. This file need to be updated in the corresponding jar by replacing an already existing .cls file in the JAR.
2. Restart the agent to allow the list of class files to be regenerated (.cls file updated with the latest list of classes).
3. Once the list is updated, go to IntroscopeAgent.profile and set introscope.agent.extensions.eagerloader=cached
- If the CACHED property is set, all the classes mentioned in the .cls file which will be loaded in the initial agent start up, and will also be cached to prevent having to be re-loaded again shall it be referenced in future. This will in turn prevent deadlocks from happening.
4. Restart the agent to put the cached setting into effect.