weak references are GC'ed when you close() your CursorableLinkedList

when do you close your CursorableLinkedList?

if you have ehcache (or any other caching mechanism) you will want to be 
proactive
about removing the cache entries for connection-objects where connection times 
out or becomes invalid

Martin
  



> Date: Tue, 22 Oct 2013 11:30:16 +0200
> Subject: Re: [dbcp] memory leak: 
> org.apache.commons.pool.impl.CursorableLinkedList$Listable
> From: andrea.bo...@gmail.com
> To: user@commons.apache.org
> 
> The word "cache" pointed me to a possible cause of the memory usage:
> prepared statement cache.
> In fact I find a lot of different statements in the heap dump (around 4000
> statements, which are less than 10000 objects instances of the class in the
> subject, but enough to ask myself if this is the reason).
> 
> I'll research in that direction.
> 
> Thank you.
> Andrea
> 
> 
> On Tue, Oct 22, 2013 at 10:42 AM, Mark Thomas <ma...@apache.org> wrote:
> 
> > On 22/10/2013 09:27, Andrea Bosio wrote:
> > > Hello all,
> > >
> > > I have an application running on Tomcat, with dbcp 1.4, which shows an
> > > abnormal memory usage.
> > > Heap memory usage grows without releasing.
> > >
> > > Analyizing an heap dump with Eclipse Memory Analyzer, I find some strange
> > > objects instances of
> > > class org.apache.commons.pool.impl.CursorableLinkedList$Listable
> > >
> > > A few objects (10) occupy a large amount of memory (50Mb or so).
> >
> > That looks perfectly normal if a connection object takes around 5Mb.
> > That does seem a little large for a connection but you'd need to dig
> > into exactly what was taking up all that space. Depending on the
> > configured caches that could be fine too.
> >
> > > Then I have a big number of objects (10.000) each one occupying small
> > > amount of memory (less than 10kb).
> >
> > What is retaining the references to these objects?
> >
> > > I think that both situations are strange.
> >
> > Nothing reported so far looks strange.
> >
> > > Do you have any suggestion?
> >
> > Do more research.
> >
> > Mark
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
> > For additional commands, e-mail: user-h...@commons.apache.org
> >
> >
> 
> 
> -- 
> Andrea Bosio
                                          

Reply via email to