commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Todd Carmichael <>
Subject [DBCP] Very small memory leak
Date Wed, 03 Mar 2004 17:01:02 GMT
Our 12 and 24 hour stress tests (300 concurrent users inserting lots of
data)  were running out of memory after about 8+ hours.  After some tests we
determined that it was DBCP.  This determination was made by switching out
the commons connection pooling and using an application server (Weblogic
8.1) connection pooling.  Using the application server connection pooling
memory was not leaked.  So doing some debugging with some long running tests
in my dev environment (using OptimizeIt), I determined that the was leaking memory with the WeakHashMap
(class member pcMap).  I don't understand why this should leak because the
jdk documentation indicates that the keys in the map are weak referenced and
when the keys are removed, the object is removed from the map.  Nonetheless,
I made the following code change (diff is in attachment) and reran my dev
tests and no leak occurred and we reran our stress tests in the performance
lab and no leak occurred there either.  Perhaps some version of the JDK is
causing this but I suspect others may run into this as well.  Included is a
patch that fixed our problem:  



View raw message