e4 RAP - Object are never destroyed when closing UISession [message #1740384] |
Fri, 12 August 2016 13:16 |
Eclipse User |
|
|
|
Hello,
I have been running through a memory problem with my Eclipse e4 RAP website. After different user connects to the website there is an Out of memory triggered by the JVM (RAP 3.1 war product deployed on Tomcat8, on CentOS server).
I realised by doing Heap Dump that singleton objects created during the UI session, were not destroyed. Should I trigger their destruction myself ? Or just "null" them ?
I am talking about UISEssion singleton, created using the snippet:
public class MySessionSingleton {
private MySessionSingleton() {
// prevent instantiation from outside
}
public static MySessionSingleton getInstance() {
return SingletonUtil.getSessionInstance( MySessionSingleton.class );
}
// other methods ...
}
Those singleton are not deleted with the garbage collector triggered ?
EDIT: If I close an MPart myself without closing the session, the objects created in this MPart are destroyed, whereas if I only close the website it does not trigger "preDestroy" of the MPart and keep the objects in the JVM.
[Updated on: Fri, 12 August 2016 13:20] by Moderator Report message to a moderator
|
|
|
|
Re: e4 RAP - Object are never destroyed when closing UISession [message #1740407 is a reply to message #1740404] |
Fri, 12 August 2016 15:00 |
Eclipse User |
|
|
|
When I look at the dependencies of the object "Chromosome" which I want to be destroyed (cf figure attached), I can see that :
It has been created inside an MPart, and this one is not destroyed. So the garbage collector by detecting that the object Chromosome IS STILL dependent of the MPart, it will not be tagged for the garbage collector, and will not be destroyed.
A walkthrough would be to close programmattically all MPart, and MWindow.
I am running :
RWT.getUISession().addUISessionListener( new UISessionListener() {
public void beforeDestroy( UISessionEvent event ) {
for(MPart part : partService.getParts()){
partService.hidePart(part);
}
}
}
But it is not closing the MPart. Any idea ?
|
|
|
Powered by
FUDForum. Page generated in 0.02508 seconds