On 8/16/07, Scott Dudley <[EMAIL PROTECTED]> wrote: > > I recently augmented a legacy connection pool with commons-dbcp. This > pool was developed in-house in 1996 or 97 before there yet existed an > array of open-source alternatives. > > The dbcp transplant was easy and straightforward and has worked > splendidly for about 6 months now. All outstanding pool-related bugs > were remedied with dbcp. > > I've recently been instrumenting the application using JProfiler and > noticed that we appear to be leaking > org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper > objects. The number of instances has grown to 500,000+ in the last 2 > days. No statistics yet on number of connections, etc. but these are > the only pool/JDBC-related objects that show up on the radar. All else > is as I would expect. > > I'm now searching to identify references (and GC roots) but wanted to > poll the forum and see if anyone else has experienced this or might > offer insight as to the cause. > PoolingDataSource$PoolGuardConnectionWrapper instances are the objects that PoolingDataSource.getConnection returns to clients. PoolGuardConnectionWrapper references should not be accumulating in dbcp itself, so if your investigation seems to indicate that this is happening, please file a bug report.
During periods of heavy use, these instances can accumulate between GC runs, since each getConnection does create a new one, but they should be garbage collected if your code does not hold references to them. Is your client code holding onto references to the Connections returned by getConnection? Phil --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
