JDK-8023310 : Thread contention in the method Beans.IsDesignTime()
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.beans
  • Affected Version: 7u10
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2013-08-19
  • Updated: 2014-04-03
  • Resolved: 2013-09-25
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 7 JDK 8
7u45Fixed 8 b110Fixed
Related Reports
Relates :  
Relates :  
Description
A recent change to Beans.IsDesignTime() in JDK7 result in threads being blocked on java.beans.ThreadGroupContext.getContext().

"[ACTIVE] ExecuteThread: '222' for queue: 'weblogic.kernel.Default
(self-tuning)'" daemon prio=10 tid=0x00002aaac9ad5000 nid=0x52d9 waiting for
monitor entry [0x000000006cd09000]
   java.lang.Thread.State: BLOCKED (on object monitor)
        at
java.beans.ThreadGroupContext.getContext(ThreadGroupContext.java:55)
        - waiting to lock <0x0000000745c75ab8> (a java.beans.WeakIdentityMap)
        at java.beans.Beans.isDesignTime(Beans.java:393)
        at
oracle.adfinternal.controller.application.AdfcPageFlowScopeProvider.getPageFlo
wScope(AdfcPageFlowScopeProvider.java:68)
        at
org.apache.myfaces.trinidadinternal.context.RequestContextImpl.getPageFlowScop
e(RequestContextImpl.java:124)
        at
org.apache.myfaces.trinidadinternal.el.TrinidadELResolver.getValue(TrinidadELR
esolver.java:71)
        at
com.sun.faces.el.DemuxCompositeELResolver._getValue(DemuxCompositeELResolver.j
ava:176)
        at
com.sun.faces.el.DemuxCompositeELResolver.getValue(DemuxCompositeELResolver.ja
va:203)
...

This is because the design-time state instead of being application global is now a thread group local variable which is synchronized and result in an increase of thread contention. 

The isDesignTime method is called all over the place in ADF run time to distinguish between a call from the page designer in JDeveloper and the weblogic app server. The way this method is implemented in JDK7 is not going to work for ADF and I imagine it might be a problem for other product too.

JDeveloper contact: charles.gayraud@oracle.com

Comments
SQE OK to take the fix to CPU14_01
14-10-2013

You could use the following performance test with the JMH framework: http://openjdk.java.net/projects/code-tools/jmh/ import org.openjdk.jmh.annotations.GenerateMicroBenchmark; import org.openjdk.jmh.annotations.Threads; public class Beans { @GenerateMicroBenchmark @Threads(value = 10) public Object isDesignTime() throws ClassNotFoundException { return java.beans.Beans.isDesignTime(); } }
25-09-2013