commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shapira, Yoav" <>
Subject RE: [DBCP] Very small memory leak
Date Wed, 03 Mar 2004 17:54:37 GMT

Seems like a well-conducted investigation and test, kudos ;)

Please open a bugzilla issue for this and attach your patch there.  (Assuming this is OK with
the active DBCP folks)

Yoav Shapira
Millennium ChemInformatics

-----Original Message-----
From: Todd Carmichael [] 
Sent: Wednesday, March 03, 2004 12:01 PM
To: 'Jakarta Commons Developers List'
Subject: [DBCP] Very small memory leak

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:  

This e-mail, including any attachments, is a confidential business communication, and may
contain information that is confidential, proprietary and/or privileged.  This e-mail is intended
only for the individual(s) to whom it is addressed, and may not be saved, copied, printed,
disclosed or used by anyone else.  If you are not the(an) intended recipient, please immediately
delete this e-mail from your computer system and notify the sender.  Thank you.

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

View raw message