avalon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Leo Sutic" <leo.su...@inspireinfrastructure.com>
Subject [Vote][Excalibur] Component Pools
Date Tue, 12 Jun 2001 08:24:49 GMT
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


Mime
View raw message