You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by Simon Laws <si...@googlemail.com> on 2009/10/22 18:15:18 UTC

Re: svn commit: r828086 -

Good spot Raymond.

I'm not so concerned about it being a String rather than an Integer
although I can of course fix that.

Garbage collecting the hash map entries will hit performance a little
but I believe the entries will be regenerated if they are removed.
While not fatal let's see if we can improve it.

We can't use the class as the key as this is what's causing the memory
leak, i.e. the $Proxy in the map also holds onto it and hence the
class is never unreferenced.

I could make this a normal map but then the $Proxy objects won't be
garbage collected and we're back where we started.

Any ideas?

Simon

Re: svn commit: r828086 -

Posted by Raymond Feng <en...@gmail.com>.
What about using a LinkedHashMap with limited size abd LRU policy?

--------------------------------------------------
From: "Simon Laws" <si...@googlemail.com>
Sent: Thursday, October 22, 2009 9:15 AM
To: <de...@tuscany.apache.org>
Subject: Re: svn commit: r828086 -

> Good spot Raymond.
> 
> I'm not so concerned about it being a String rather than an Integer
> although I can of course fix that.
> 
> Garbage collecting the hash map entries will hit performance a little
> but I believe the entries will be regenerated if they are removed.
> While not fatal let's see if we can improve it.
> 
> We can't use the class as the key as this is what's causing the memory
> leak, i.e. the $Proxy in the map also holds onto it and hence the
> class is never unreferenced.
> 
> I could make this a normal map but then the $Proxy objects won't be
> garbage collected and we're back where we started.
> 
> Any ideas?
> 
> Simon