You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Ben Lindahl <be...@appiancorp.com> on 2005/04/18 22:08:54 UTC

Negative value for numActive under high load

I have an application that uses GenericObjectPool in Commons Pool.
Under relatively high loads (perhaps 10-20 borrowed objects per second),
one of the pools is returning a negative number of active connections
when getNumActive is called.  Overall, a report on the pool shows the
following numbers:

Active/Max Active   -6/10

Idle/Max Idle       10/10

Created/Destroyed   24/20

 

The last value is one that we are tracking ourselves by implementing
connectionCreated() and connectionDestroyed().

 

Besides the negative numActive, it is also strange that 20 connections
are destroyed, even though maxIdle is set to the same thing as maxActive
(so no more than 10 connections should be created, and therefore none
should ever have to be destroyed).  When maxIdle==-1, the number of
connections created is also greater than 10, but the number of
connections destroyed is 0 and numActive is 0.  An interesting point
about these numbers is that numActive+numIdle+numDestroyed==numCreated.
This fact still holds true even though there are a negative number of
active connections.

 

I have tried searching bug reports on this, but was unable to come up
with anything.  I am hoping that it is an implementation issue on our
side, so that we can fix it quickly.

 

Thanks in advance.

 

Ben Lindahl