Project

General

Profile

Bug #2242

MultiClassLoader does not allow profiler jars to be loaded in live phase

Added by Constantin Asofiei over 10 years ago. Updated over 10 years ago.

Status:
Closed
Priority:
Normal
Target version:
-
Start date:
02/13/2014
Due date:
% Done:

100%

billable:
No
vendor_id:
GCD
case_num:
version_reported:
version_resolved:

ca_upd20140213a.zip (5.9 KB) Constantin Asofiei, 02/13/2014 03:21 AM

History

#1 Updated by Constantin Asofiei over 10 years ago

Eric's note:

Before I put an item in Redmine for this, I wanted to get an idea of scope of effort.

I've noticed that after we swapped out the system classloader with our own implementation, I can no longer do some important tasks in jvisualvm. Basically, jvisualvm and other tools like it are far less useful than they used to be, and we have lost critical insight into the software.

When I connect jvisualvm to the server, I get this in the P2J server.log:

System class loader does not support adding JAR file to system class path during the live phase!
Unable to add /usr/lib/jvm/java-7-openjdk-common/jre/lib/management-agent.jar to system class path - not supported by system class loader or configuration error!

I can connect and monitor some basics and Visual GC seems to work, but CPU sampling is unavailable, MBeans are unavailable, the thread view is unavailable.

This only has been a mild nuisance so far, but as we dig into the upcoming performance and scalability milestones, and even to some degree for M11, we will need this to work again. Customers will need this as well.

My work with custom classloaders has been limited to the ones behind TRPL and in com.goldencode.proxy -- basically just loading class definitions from in-memory byte streams. I haven't done anything with JMX or enabling external tools like jvisualvm.

Any thoughts on what we need to do to enable this and level of effort?

#2 Updated by Constantin Asofiei over 10 years ago

Although googling for this error did not provide any help, digging into the openjdk sources for this error message did help.

Our MultiClassLoader was missing a hidden feature for the classloaders: to allow loading a jar during the live phase, the class loader is required to have a private void appendToClassPathForInstrumentation(String) method: this is invoked by the native VM code to load a jar.

See the attached update. Let me know if it helps.

LE: the missing features in jvisualvm seem to be working now, please let me know if something else is still unavailable.

#3 Updated by Eric Faulhaber over 10 years ago

  • Status changed from WIP to Test
  • % Done changed from 0 to 80

Brilliant, Constantin! It works beautifully. Please include this update with your next regression test run.

#4 Updated by Constantin Asofiei over 10 years ago

  • % Done changed from 80 to 100

Passed testing, committed to bzr rev 10468.

#5 Updated by Eric Faulhaber over 10 years ago

  • Status changed from Test to Closed

This seems to be working consistently during normal development, so I am closing this issue.

Also available in: Atom PDF