You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Phillip Thurmond <pt...@redhat.com> on 2007/03/12 23:47:12 UTC

Contention in ApplicationContext.java in Tomcat 5.5

I'm running some performance tests on JBoss 4.0.5.  I'm seeing some 
contention inside Tomcat on ApplicationContext.getAttribute().  With a 
load of 200 threads, I often see over 150 "waiting to lock" messages on 
the attributes object.  It looks like this contention has already been 
fixed in Tomcat 6 using the Java 5 concurrent objects.  Could this be 
fixed in Tomcat 5.5 using some other concurrency libs (oswego)?  Thanks.

Example thread dump:

"http-10.68.0.196-8080-301" daemon prio=1 tid=0x0000002b51e425b0 
nid=0x78a5 waiting for monitor entry 
[0x000000005b86c000..0x000000005b86cdb0]
       at 
org.apache.catalina.core.ApplicationContext.getAttribute(ApplicationContext.java:175) 

       - waiting to lock <0x0000002aabd633b0> (a java.util.HashMap)
       at 
org.apache.catalina.core.ApplicationContextFacade.getAttribute(ApplicationContextFacade.java:315) 

       at 
org.apache.myfaces.context.servlet.ApplicationMap.getAttribute(ApplicationMap.java:41) 

       at 
org.apache.myfaces.context.servlet.AbstractAttributeMap.get(AbstractAttributeMap.java:87) 

       at 
org.jboss.seam.contexts.FacesApplicationContext.get(FacesApplicationContext.java:47) 

       at org.jboss.seam.Component.forName(Component.java:1588)
       at org.jboss.seam.Component.getInstance(Component.java:1636)
       at org.jboss.seam.Component.getInstance(Component.java:1631)
       at org.jboss.seam.Component.getInstance(Component.java:1608)
       at org.jboss.seam.Component.getInstance(Component.java:1603)
       at org.jboss.seam.core.Events.instance(Events.java:158)
       at 
org.jboss.seam.jsf.AbstractSeamPhaseListener.afterPhase(AbstractSeamPhaseListener.java:139) 

       at 
org.jboss.seam.jsf.SeamPhaseListener.afterPhase(SeamPhaseListener.java:69)



--Phillip

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: Contention in ApplicationContext.java in Tomcat 5.5

Posted by Remy Maucherat <re...@apache.org>.
Yoav Shapira wrote:
> Hola,
> 
> On 3/13/07, Phillip Thurmond <pt...@redhat.com> wrote:
>> This is a bug.  It significantly hinders scalability under certain
>> workloads, and it should be fixed.  As you are aware, there are many
>> solutions (Read/Write lock, partitioned hashmap, etc..) that do not
>> involve an additional dependency.
> 
> Feel like submitting a patch?

-1 for this (= veto). As I said, I will not accept extra dependencies. 
You have to look at the use case: most definitely applications do not 
need to query context attributes (which are obviously synced to some 
extent, thus potentially expensive) once each request.

Rémy

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: Contention in ApplicationContext.java in Tomcat 5.5

Posted by Yoav Shapira <yo...@apache.org>.
Hola,

On 3/13/07, Phillip Thurmond <pt...@redhat.com> wrote:
> This is a bug.  It significantly hinders scalability under certain
> workloads, and it should be fixed.  As you are aware, there are many
> solutions (Read/Write lock, partitioned hashmap, etc..) that do not
> involve an additional dependency.

Feel like submitting a patch?

Yoav

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: Contention in ApplicationContext.java in Tomcat 5.5

Posted by Phillip Thurmond <pt...@redhat.com>.
Remy Maucherat wrote:
> Phillip Thurmond wrote:
>> I'm running some performance tests on JBoss 4.0.5.  I'm seeing some 
>> contention inside Tomcat on ApplicationContext.getAttribute().  With 
>> a load of 200 threads, I often see over 150 "waiting to lock" 
>> messages on the attributes object.  It looks like this contention has 
>> already been fixed in Tomcat 6 using the Java 5 concurrent objects.  
>> Could this be fixed in Tomcat 5.5 using some other concurrency libs 
>> (oswego)?
>
> Simple question, simple answer: no (reason: no additional dependency).
>
> Rémy
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: dev-help@tomcat.apache.org
>
This is a bug.  It significantly hinders scalability under certain 
workloads, and it should be fixed.  As you are aware, there are many 
solutions (Read/Write lock, partitioned hashmap, etc..) that do not 
involve an additional dependency.

--Phillip

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: Contention in ApplicationContext.java in Tomcat 5.5

Posted by Remy Maucherat <re...@apache.org>.
Phillip Thurmond wrote:
> I'm running some performance tests on JBoss 4.0.5.  I'm seeing some 
> contention inside Tomcat on ApplicationContext.getAttribute().  With a 
> load of 200 threads, I often see over 150 "waiting to lock" messages on 
> the attributes object.  It looks like this contention has already been 
> fixed in Tomcat 6 using the Java 5 concurrent objects.  Could this be 
> fixed in Tomcat 5.5 using some other concurrency libs (oswego)?

Simple question, simple answer: no (reason: no additional dependency).

Rémy

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org