JDK-7022186 : (proxy) Proxy should use CHM to reduce contention on the loaderToCache map
  • Type: Enhancement
  • Component: core-libs
  • Sub-Component: java.lang:reflect
  • Affected Version: 7
  • Priority: P4
  • Status: Resolved
  • Resolution: Duplicate
  • OS: linux
  • CPU: x86
  • Submitted: 2011-02-24
  • Updated: 2013-04-12
  • Resolved: 2013-04-12
Related Reports
Duplicate :  
Description
A DESCRIPTION OF THE REQUEST :
Integrate the small change in ConcurrentProxy from the commons-reflect library (from http://commons-reflect.sf.net ).

java.lang.Proxy.getProxyClass(..) is a weak spot in any JVM using many Proxy classes (jboss, spring, etc etc) and can quickly jam the JVM up with thread contention.

ConcurrentProxy successfully removes this bottleneck.

See http://commons-reflect.sourceforge.net/xref/no/sesat/commons/reflect/ConcurrentProxy.html

All it does is introduce a "loaderToCache" map and a read/write lock around it.
Using this to <map a class loader to the proxy class cache for that loader> the hard synchronization block can be replaced the read/write locking pattern.


JUSTIFICATION :

java.lang.Proxy.getProxyClass(..) is a weak spot in any JVM using many Proxy classes (jboss, spring, etc etc) and can quickly jam the JVM up with thread contention.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Non blocking reads of Proxy.getProxyClass(..)
ACTUAL -
Blocking reads of Proxy.getProxyClass(..)
 and a jammed up JVM.

---------- BEGIN SOURCE ----------
http://commons-reflect.sourceforge.net/xref/no/sesat/commons/reflect/ConcurrentProxy.html
---------- END SOURCE ----------

Comments
EVALUATION This improvement is being discussed here: http://mail.openjdk.java.net/pipermail/core-libs-dev/2011-July/007201.html
25-07-2011