Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » UISession not closed
UISession not closed [message #1745617] Thu, 13 October 2016 11:52 Go to next message
Marcel Konopka is currently offline Marcel KonopkaFriend
Messages: 4
Registered: July 2016
Junior Member
Hey,

I noticed that sometimes the UISessions are not closed correctly.
This happens for example if the connection gets lost or if the browser process is killed forcefully (if you want to reproduce it).
Since the default timeout is infinite, doesn't that mean we are producing a memory leak here?
Since I'm not happy with just setting timeout to a low value, is there something like a heartbeat in RAP, to detect if the connection is really lost?

Thanks,
Marcel
Re: UISession not closed [message #1745644 is a reply to message #1745617] Thu, 13 October 2016 19:28 Go to previous messageGo to next message
Chris Fairhall is currently offline Chris FairhallFriend
Messages: 197
Registered: February 2011
Senior Member
Unless you have an active ServerPush session, there is no continuous connection.

If you do have one running all the time, depending on the behaviour* of container, you may be able to have a very, very short session timeout.

* that is, if it treats sessions with long running connections as alive
Re: UISession not closed [message #1745669 is a reply to message #1745644] Fri, 14 October 2016 09:22 Go to previous messageGo to next message
Dmitry Dukhov is currently offline Dmitry DukhovFriend
Messages: 117
Registered: February 2013
Senior Member
Chris, if I understood you right to Marcel have to create Server Push session and checking UISessions for alive or not. if it's not to destroy session. Is it so?
Re: UISession not closed [message #1745679 is a reply to message #1745617] Fri, 14 October 2016 12:06 Go to previous messageGo to next message
Marcel Konopka is currently offline Marcel KonopkaFriend
Messages: 4
Registered: July 2016
Junior Member
Thanks, that already helped alot.

Now I have:

RWT.getUISession().addUISessionListener(e -> {
	System.out.println(e);
});

RWT.getUISession().getHttpSession().setMaxInactiveInterval(30);

ServerPushSession pushSession = new ServerPushSession();
pushSession.start();
RWT.getUISession().setAttribute("_server_push", pushSession);


Thats already works fine and it detects, if the user disconnects.
The Problem now is that if I lower the value to 5 secs, it still needs up to around 30s to detect the disconnect.

Do you have any ideas why this is the case?
Re: UISession not closed [message #1745741 is a reply to message #1745679] Sun, 16 October 2016 23:01 Go to previous messageGo to next message
Chris Fairhall is currently offline Chris FairhallFriend
Messages: 197
Registered: February 2011
Senior Member
The servlet container will only be checking the sessions periodically.
Tomcat uses a dedicated thread for this, other containers might have timers. Nothing is going to react immediately.

If you absolutely must go down this path, you'll probably have to write your own session expiration code.

Why do you need to disconnects to be detected so quickly?
Re: UISession not closed [message #1752616 is a reply to message #1745741] Wed, 25 January 2017 15:34 Go to previous message
Christophe Becavin is currently offline Christophe BecavinFriend
Messages: 60
Registered: April 2011
Location: France
Member
It is a known issue, even if the UISession is kind of closed the JVM does not run the garbage collector and your UI objects are not destroyed. Do a memory analyser of your JVM after closing abruplty a session you will see it is not void.

Me I register a listener of the closing session and close MPart and destroy manually all objects :
https://www.eclipse.org/forums/index.php/m/1740407/#msg_1740407
Previous Topic:[SOLVED] How-to ? URL formatting with deeplink and parameters
Next Topic:Problem with background color on Chrome
Goto Forum:
  


Current Time: Sun May 27 01:44:37 GMT 2018

Powered by FUDForum. Page generated in 0.02314 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top