For me, this clearly looks like concurrent usage of the request map.

All the servlet scopes (session, request, …) are not thread safe and one has
to assure that they are not accessed at the same time by multiple threads.

 

This turns out to be hard as e.g. there is no "standard" how to synchronize
against the session map. As a side note: I often wonder why this does not
lead to much more problems in the wild …

 

Anyway, in your case it seems the internal datastructure of the request map
is damaged - which in fact is strange as I do not know when the request map
will be accessed by multiple threads.

 

Sorry that this is not a solution, but it should give you a clue where to
look next …

 

Ciao,

Mario

 

Von: Jan Baudisch [mailto:jan.baudi...@gmx.net] 
Gesendet: Donnerstag, 10. Dezember 2009 08:02
An: MyFaces Discussion
Betreff: 100% CPU Usage and blocking concurrent Threads when using
t:saveState

 

Hello MyFaces Community,

 

we are using MyFaces 1.2.0 with Tomahawk Sandbox  1.1.5 and have the
problem, that once in a while we get 100% CPU Usage and blocking concurrent
threads because of using t:saveState

 

A thread dump shows that the threads always stops at

 

        at java.util.TreeMap.put(TreeMap.java:545)

        at
org.apache.myfaces.custom.redirectTracker.RedirectTrackerManager.addSaveStat
eBean(RedirectTrackerManager.java:306)

        at
org.apache.myfaces.custom.redirectTracker.RedirectTrackerVariableResolver.re
solveVariable(RedirectTrackerVariableResolver.java:50)

 

(The complete thread dump is attached). The problem shows up on one system
with heavy concurrent usage and JxBrowser as client.

 

After we kill these threads using Lambda Probe, the CPU Usage normalizes.

 

The problem occurs in that method:

 

...

    public void addSaveStateBean(String expressionString, Object value)

    {

        if(log.isDebugEnabled())

            log.debug("addSaveStateBean: " + expressionString + " value=" +
value);

        requestBeanMap.put(expressionString, value);

    }

...

    private final Map requestBeanMap = new TreeMap(); ...

 

As the problem is really severe for us, any hints are highly appreciated.

 

Many thanks in advance,

-- Jan 

 

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to