[prev in list] [next in list] [prev in thread] [next in thread] 

List:       slide-dev
Subject:    =?ISO-8859-1?Q?Re:_jakarta_=A0SLIDE?=
From:       Antoine Levy-Lambert <antoine () gmx ! de>
Date:       2007-02-19 3:57:05
Message-ID: B017F5B0-9B0D-42DC-BBA6-11D1824D8CB8 () gmx ! de
[Download RAW message or body]

Hello Bruno,




Hi,

Bruno Dorel has contacted me off list concerning a problem of memory  
leak in the class ExtendedStore (src/share/org/apache/slide/store/ 
ExtendedStore.java).

Bruno, some comments about the new version of ExtendedStore.java that  
you mailed me :

1) we would like to avoid making incompatible API changes in public  
methods

2) I do not understand why changing the signature of public void  
removeObjectFromCache(Object key) to removeObjectFromCache(Uri key)  
solves a problem.
toString() should always return the toString() implementation of the  
object passed, so if the object is an Uri it should call Uri.toString().

In the version of ExtendedStore.java that you mailed me, there are  
also some changes in logging behavior which should not be required.

What I noticed is that you want to change the default size of a  
number of caches. Maybe this is what really helps you fixing the  
memory issue ?

Is there a bug report in Bugzilla for this ? I would recommend  
opening one.

Best regards,

Antoine

On Feb 16, 2007, at 9:55 AM, Bruno DOREL wrote:

>
> M. Levy-Lambert
>
> Merci pour votre réponse :
>
> En Utilisant JProfiler nous avons pu constater que des Objets Uri  
> n'étaient pas recyclés et restaient en pile (heap) Nous avons  
> trouvé une fuite mémoire dans la classe Extended store au niveau de  
> la méthode removeObjectFromCache(Object key ) l'objet key passé en  
> paramètre est en fait un Uri si l'on déclare le paramètre d'appel  
> avec le type Uri les objets sont bien recyclés
>
>
>
>    /**
>      * Removes an object from all internal caches.
>      *
>      * @param key the key under which the object is stored in the  
> caches.
>      *
>      * BD/EADS the key is allways a Uri
>      * public void removeObjectFromCache(Object key ) { is a bug  
> because java
>      * calls Object.toString and not Uri.toString so  
> removeObjectFromCache won't
>      * remove anything
>      *
>      *
>      */
>     public void removeObjectFromCache(Uri key ) {
>         if (getLogger().isEnabled(LOG_CHANNEL, Logger.DEBUG)) {
>             getLogger().log( "Removing " + key.toString() + " from  
> cache.",
>               LOG_CHANNEL,
>            Logger.DEBUG );
>         }
>      if ( contentStore.cacheResults() && contentCachingEnabled ) {
>       contentCache.remove( key.toString(), "_" );
>      }
>      if ( nodeStore.cacheResults() ) {
>       objectsCache.remove( key.toString() );
>      }
>      if ( securityStore.cacheResults() ) {
>       permissionsCache.remove( key.toString() );
>      }
>      // Locks shouldn't be cached, but just in case.
>      if ( lockStore.cacheResults() ) {
>       locksCache.remove( key.toString() );
>      }
>      if ( revisionDescriptorsStore.cacheResults() ) {
>       descriptorsCache.remove( key.toString() );
>      }
>      if ( revisionDescriptorStore.cacheResults() ) {
>       descriptorCache.remove( key.toString(), "-" );
>      }
>     }
>
>
> qu'en pensez vous ? j'ai joint le fichier extendedKeyStore tel que  
> nous l'avons codé aujourd'hui (il prend en compte d'autres  
> modification qui feront l'objet de mes prochains mails
>
> en attendant une réponse
>
> Cordialement
>
> B DOREL
>
>
> <ExtendedStore.java>


---------------------------------------------------------------------
To unsubscribe, e-mail: slide-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-dev-help@jakarta.apache.org


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic