| CacheAdapter.inverseCrossReferencer and Memory Leaks [message #690216] |
Wed, 29 June 2011 03:45  |
Kirsten M. Z. Messages: 106 Registered: July 2010 |
Senior Member |
|
|
Hi @all,
I am struggling against some memory issues, and I have been analyzing for several days now. As far as I can see, using MAT, the problem could be caused by CacheAdapter (i.e. its inverseCrossReferencer) which is not removing old resources.
I have coded a (graphical) UML editor which uses EMF/UML2 internally. Whenever I close an old model and reload it, I waste about 30 MBytes (a small model) which is far to much for ignoring this problem.
Learning from other threads on this board and own investigations, I already use the following code in order to unload my resources and resource set (BTW, there is a regular UML model and several UML profiles in my resource set):
while(getResourceSet().getResources().size() > 0) {
Resource res = getResourceSet().getResources().get(0);
res.eAdapters().clear();
res.unload();
getResourceSet().getResources().remove(res);
}
CacheAdapter.INSTANCE.clear();
I found the following threads or bug entries within this forum about a similar topic. However, bugs seem to be fixed and the issues solved.
http://www.eclipse.org/forums/index.php/m/624261
http://www.eclipse.org/forums/index.php/m/647513
https://bugs.eclipse.org/bugs/show_bug.cgi?id=197079
Now, I need to get some background information. I already debugged into sources, but sorry, I cannot really figure out the mechanism why (or how) the InverseCrossReferencer does not remove old stuff when unloading. I also haven't found a way to reset the state completely or to use another CacheAdapter, which could also solve the problem. Maybe, CacheAdapter$inverseCrossReferencer is not the only problem (I am still wondering if I can trust MAT), so your experience would help. Please tell me scenarios in which clearing the cache or unloading could fail or even tutorials on unloading.
Thanks in adavance!
[Updated on: Wed, 29 June 2011 03:47] Report message to a moderator
|
|
|