-
Enhancement
-
Resolution: Fixed
-
P4
-
5.0
-
b37
-
generic
-
generic
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2127897 | 5.0u7 | Shanliang Jiang | P3 | Closed | Won't Fix |
From Stefan Guntlin:
<<<
we are developing an application using the JMX1.2.1 libraries that registers
a lot of standard mbeans in the MBeanServer. Most of these mbeans are of the
same type. We noticed a performance bottleneck in the registering process.
When a standard mbean is beeing registered, the Method testCompliance(Class
c) of the class StandardMetaDataImpl.java is called.
/**
* This methods tests if the MBean is JMX compliant
*/
public synchronized void testCompliance(Class c)
throws NotCompliantMBeanException {
// ------------------------------
// ------------------------------
final MBeanInfo mbeanInfo = buildMBeanInfo(c);
final Class mbeanInterface = Introspector.getMBeanInterface(c);
cacheMBeanInfo(c,mbeanInterface,mbeanInfo);
}
That means that for every mbean the MBeanInfo is newly built which is quite
a time consuming operation. Why it is not checked first if the MBeanInfo is
already in the cache like below?
if (getCachedMBeanInfo(c)==null) {
final MBeanInfo mbeanInfo = buildMBeanInfo(c);
final Class mbeanInterface = Introspector.getMBeanInterface(c);
cacheMBeanInfo(c, mbeanInterface, mbeanInfo);
}
After all the mbeans are standard mbeans and are not supposed to change
their mbean-interface as long as they are registered in the MBeanServer. Is
there something I am missing here?
>>>
<<<
we are developing an application using the JMX1.2.1 libraries that registers
a lot of standard mbeans in the MBeanServer. Most of these mbeans are of the
same type. We noticed a performance bottleneck in the registering process.
When a standard mbean is beeing registered, the Method testCompliance(Class
c) of the class StandardMetaDataImpl.java is called.
/**
* This methods tests if the MBean is JMX compliant
*/
public synchronized void testCompliance(Class c)
throws NotCompliantMBeanException {
// ------------------------------
// ------------------------------
final MBeanInfo mbeanInfo = buildMBeanInfo(c);
final Class mbeanInterface = Introspector.getMBeanInterface(c);
cacheMBeanInfo(c,mbeanInterface,mbeanInfo);
}
That means that for every mbean the MBeanInfo is newly built which is quite
a time consuming operation. Why it is not checked first if the MBeanInfo is
already in the cache like below?
if (getCachedMBeanInfo(c)==null) {
final MBeanInfo mbeanInfo = buildMBeanInfo(c);
final Class mbeanInterface = Introspector.getMBeanInterface(c);
cacheMBeanInfo(c, mbeanInterface, mbeanInfo);
}
After all the mbeans are standard mbeans and are not supposed to change
their mbean-interface as long as they are registered in the MBeanServer. Is
there something I am missing here?
>>>
- backported by
-
JDK-2127897 MBeanInfo for Standard MBeans could be got from cache on creation
-
- Closed
-