avalon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Donald <dona...@apache.org>
Subject Re: [Vote][Excalibur] Component Pools
Date Tue, 12 Jun 2001 12:43:13 GMT
Seems like a reasonable change though I don't use it so I couldn't tell you
accurately. Berin/Cocooners could probably give you a better appraisal. 

Personally I would be interested in seeing ComponentHandler static as non
static and instead implemented by some form of
ComponentHandlerFactory/Manager.  I would also be interested in seeing the
type of pool customizable in all sorts of manner.

However as I said I don't use it so can't say how feasible this is ;) 

Berin???


At 10:24 AM 6/12/01 +0200, Leo Sutic wrote:
>All,
>
>the Excalibur component manager has a severe fault: It is not possible to
>choose the size of the component pools. (Nor is it possible to subclass the
>PoolableComponentHandler in a neat way as the m_pool member is private and
>thus not accessible for subclasses.)
>
>This means that in a heavily multithreaded environment (40+ threads), the
>pool will (almost) always try to create new component instances, degrading
>performance and leading to:
>
>java.lang.Exception: Could not create enough Components to service your
>request.
>	at org.apache.avalon.excalibur.pool.DefaultPool.get(DefaultPool.java:135)
>	at
>org.apache.avalon.excalibur.component.PoolableComponentHandler.get(PoolableC
>omponentHandler.java:111)
>	at
>org.apache.avalon.excalibur.component.ExcaliburComponentManager.lookup(Excal
>iburComponentManager.java:265)
>
>
>The solution I see is:
>
>Include "hints" in the Configuration object sent to the component
>manager/handler. For example, we could let the attributes
>excalibur:poolMaxSize, and excalibur:poolMinSize specify the maximum and
>minimum sizes of the pool. The default values would be as in the
>AbstractPool (the current defaults). The advantages are:
>  + Unchanged (Java) interface to the component manager, preserving binary
>compatibility.
>  + Easily configurable pool parameters.
>
>Disadvantages:
>  - Creates some "magic attributes".
>  - Changes interface of DefaultComponentPool, PoolableComponentHandler
>
>So I'd like to call for a vote on this. Should the ExcaliburComponentManager
>and related classes be changed to accept these attributes in the
>Configuration object passed to the addComponent method?
>
>/LS
>
>I also keep getting these, and I am certain that I'm *not* trying to release
>a component that I have not obtained through the same component manager:
>
>WARN    44153   [cocoon  ] (Thread-18): Pool interrupted while waiting for
>lock.
>java.lang.IndexOutOfBoundsException: Index: -1, Size: 50
>	at java.util.ArrayList.RangeCheck(ArrayList.java:491)
>	at java.util.ArrayList.remove(ArrayList.java:375)
>	at org.apache.avalon.excalibur.pool.DefaultPool.put(DefaultPool.java:174)
>	at
>org.apache.avalon.excalibur.component.PoolableComponentHandler.put(PoolableC
>omponentHandler.java:131)
>	at
>org.apache.avalon.excalibur.component.ExcaliburComponentManager.release(Exca
>liburComponentManager.java:381)
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: avalon-dev-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: avalon-dev-help@jakarta.apache.org
>
>
Cheers,

Pete

*-----------------------------------------------------*
| "Faced with the choice between changing one's mind, |
| and proving that there is no need to do so - almost |
| everyone gets busy on the proof."                   |
|              - John Kenneth Galbraith               |
*-----------------------------------------------------*


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


Mime
View raw message