|CacheAdapter Memory Leak [message #624250]
||Thu, 02 August 2007 16:53
| Steffen Becker
Registered: July 2009
Dear UML2 Developers,|
in the oAW component in the GMT projects we came across a problem and
currently don't know how to solve it. Maybe you can help...
We are loading an UML2 Profile into different ResourceSets several
times. After accessing the information of the Profile (for code
completion, for example) we abandon the ResourceSet in hope of the
garbage collector collecting it and freeing the memory again. Before we
stop using the Profile, we even unload it from the ResourceSet by
calling profileResource.unload(). However, the memory is not released.
In the memory profiler we see that the class CacheAdapter or
CacheAdapter$InverseCrossReferencer allocate the memory. (See Bug 197079
for the memory profiler's result).
I suspected the CacheAdapter to not unregister itself from the resource
when the resource gets unloads. Hence, I forced the removal of the
adapter by calling resource.eAdapters.clear(). This solved a part of the
problem, one test we have is working now. However, there is still a test
failing with OutOfMemory.
First question is, are we doing something wrong? Is the API expecting a
different call or call order? Is it a bug that the Adapter is not
removed when the resource gets unload?
Second question is: can you think of other locations in the code which
might hold a reference to the CacheAdapter preventing it from being
garbage collected? Any hints on what to search for?
Thanks in advance for any help.
Powered by FUDForum
. Page generated in 0.01579 seconds