You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-dev@db.apache.org by "Armin Waibel (JIRA)" <ji...@apache.org> on 2005/12/05 21:45:08 UTC

[jira] Resolved: (OJB-44) ReferenceMap$Entry keeps growing over period of application usage.

     [ http://issues.apache.org/jira/browse/OJB-44?page=all ]
     
Armin Waibel resolved OJB-44:
-----------------------------

    Fix Version: 1.0.4
     Resolution: Cannot Reproduce

I run a heavy loading test using anonymous fields, but I can't reproduce the memory leak. The JVM heap was constant during the whole test and the profiler memory view doesn't show noticeable problems.

Think your proposed solution will not work correct in all cases, because the map value object represents the anonymous field value and  in most cases this field is only referenced by the fkCache-Map, thus if we use a weak reference too, the value of the anonymous field can be coincidental GC (and we lose the anonymous field value).

If you still can reproduce this issue with latest version of OJB, please let us know and provide a test case (or some pseudo code example) to reproduce the leak.

> ReferenceMap$Entry keeps growing over period of application usage.
> ------------------------------------------------------------------
>
>          Key: OJB-44
>          URL: http://issues.apache.org/jira/browse/OJB-44
>      Project: OJB
>         Type: Bug
>   Components: PB-API
>     Versions: 1.0.3
>  Environment: Windows 2000 Professional, Jboss (3.2.5)
>     Reporter: Srikanth R
>      Fix For: 1.0.4

>
> We are using OJB in one of our application which is very much database intensive. When we put the application under load testing, the memory kept on growing and at one stage, the application became very slow as there was hardly any memory left on the machine. We were forced to re-start the app server.
> On putting the application under a profiler, we observed that, the "ReferenceMap$Entry" kept on growing in size. Also we saw some of our application specific objects in memory as it was not released to the garbage collector. We changed the "AnonymousPersistentField.java",  to wrap the value as a weak reference. The code snippet is given below:
> protected void putToFieldCache(Object key, Object value)
> {
>   ...
>   fkCache.put(key, new WeakReference(value));
>   ...
> }
> Similarly the "getFromFieldCache" is changed to un-wrap the value.
> Ideally the memory should come down to the original value after each transaction.
> After doing these changes, we found NO references to our application specific objects in the memory but still "ReferenceMap$Entry" kept growing in size.
> Let me know if the fix is a correct one and how to clear of "ReferenceMap$Entry". 
> We are using "org.apache.ojb.broker.cache.ObjectCachePerBrokerImpl" as the caching implemetation and the broker is closed at the end of the transaction.
> Thanks,
> Sriki

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


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