dev@grizzly.java.net

Re: A question about outbound connection cache

From: Minoru Nitta <minoru.nitta_at_jp.fujitsu.com>
Date: Fri, 27 Feb 2009 08:49:41 +0900

Hi Alexey,


> Hi Minoru,
>
> >>>
> >>> I tested with grizzly-framework-1.9.6-20090223.215705-46.jar and
> >>> grizzly-utils-1.9.6-20090223.215705-47.jar. It worked !! Thank you.
> >>>
> >>> CacheableConnectorHandler implementation is different from 1.9.5.
> >>> I have not examined the code, but I guessed that's the reason.
> >> Yes, you're right. I've changed it a bit to avoid problems with Map,
> >> which you mentioned.
> >>
> >> Thanks.
> >
> >
> > Then, this time, I have a question about
> > OutboundConnectionCacheBlockingImpl.close method.
> >
> > :
> > :
> > try {
> > conn.close() ;
> > } catch (IOException exc) {
> > if (debug())
> > dprint( ".close: " + conn + ": Caught IOException on
> > close:"
> > + exc ) ;
> > }
> >
> > /* FIX --> */
> > if (cs.entry.totalConnections() == 0){
> > ContactInfo cinfo = cs.cinfo;
> > entryMap.remove(cinfo);
> > }
> >
> > Above code is needed?
> Well, I'm not original author of OutboundConnection cache, so can not
> be sure... Do you see any problem with that part?

Sorry for asking you about this code, but I have a problem.

I modified OutboundConnectionCacheBlockingImpl to monitor sizes of each
HashMaps in it.

I found out that entries in connectionMap are removed in close method,
but entries of entryMap are never removed. I think there is potentially memory
leak problem in OutboundConnectionCacheBlockingImpl.

Minoru

> Thanks.
>
> WBR,
> Alexey.