commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Phil Steitz" <>
Subject [pool] 1.2, 1.4-RC1 maxActive can be exceeded by one
Date Fri, 04 Jan 2008 02:47:23 GMT
Load tests using sandbox/performance with the config below picked up
(number of makes - number of destroys) = maxActive + 1 under both pool
1.2 and 1.4-RC1.  What is going on is that the config enables the idle
object evictor and sets minIdle > 0 and makes the "evictor" run
frequently.  When it runs, it often has to create idle instances.  It
is correctly gating the number created using calculateDeficit, but
when addObject initiates a makeObject, it does not increment numActive
before the make.  This allows a borrowObject to jump in, increment the
counter and initiate another make.   Any ideas or patches on how best
to fix this would be appreciated.  My first thought was to increment
numActive in addObject, but that is not correct, since it is actually
numIdle that needs to be incremented and that is read directly from
the pool. It is probably best to add a total instance counter. Then
stick with the pattern increment before make, decrement after destroy.
 This does not apply to GenericKeyedObjectPool, since there
ensureMinIdle is synchronized.  Another solution would be to
synchronize either or both of ensureMinIdle or addObject (as in 1.3,
which passes the test, though with almost 10x slower average
performance).  That could have performance impacts; however, when
makes are expensive.  Ideas / patches (against
branches/1_4_RELEASE_BRANCH) welcome.

    <!-- GenericObjectPool or AbandonedObjectPool -->
    <!-- block, fail, or grow -->

  <!-- Ignored unless pool type is AbandonedObjectPool -->

    <!-- constant, gaussian, or poisson -->
    <!-- none, linear, random -->
    <!-- none, oscillating (others?)-->


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message