Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Remaining objects after closing the session of the demo rap appl.
Remaining objects after closing the session of the demo rap appl. [message #100272] Mon, 28 July 2008 07:24 Go to next message
Eclipse UserFriend
Originally posted by: oliver.petrovski.est.fujitsu.com

Hello,
I checked the memory consumption of the RAP demo application. Each new
session creates a new workbench that is not closed when the session
terminates. So each session leaves a lot of objects from package
org.eclipse.ui.internal after closing the session (classes Workbench*).
What is the reason for not cleaning up?


I tested on Suse Linux 10.2, with RAP 1.1.0 , Tomcat 5.0, JDK 1.5, JProbe.

Regards,
Oliver
Re: Remaining objects after closing the session of the demo rap appl. [message #100330 is a reply to message #100272] Mon, 28 July 2008 12:40 Go to previous messageGo to next message
Stefan   is currently offline Stefan Friend
Messages: 316
Registered: July 2009
Senior Member
Hi Oliver,

as the workbench is implemented as a SessionSingleton, it should be
disposed when the session is destroyed. If this isn't the case in your
application there probably is a static reference to one of the session
objects, widgets or whatever.

I good starting point to find this kind of leaks besides the Workbench
instance is the SWT Display object which exists once per session.

Btw, you do you terminate your sessions?

Hth,
Stefan.

Oliver Petrovski schrieb:
> Hello,
> I checked the memory consumption of the RAP demo application. Each new
> session creates a new workbench that is not closed when the session
> terminates. So each session leaves a lot of objects from package
> org.eclipse.ui.internal after closing the session (classes Workbench*).
> What is the reason for not cleaning up?
>
>
> I tested on Suse Linux 10.2, with RAP 1.1.0 , Tomcat 5.0, JDK 1.5, JProbe.
>
> Regards,
> Oliver
Re: Remaining objects after closing the session of the demo rap appl. [message #100823 is a reply to message #100330] Tue, 29 July 2008 21:00 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: tavoaqp.gmail.com

I'm sorry, but how do you terminate a session? I have the same problem
as Oliver, I have implemented a subclass of SessionSingletonBase which
also has a dispose method I call in postWindowClose method at
WorkbenchWindowAdvisor. I have also implemented the dispose method in
all the subclasses of ViewPart and setting to null any widget that
composes those views. And still, when I log out my application the
server memory usage increases instead of decreasing (Tomcat 6+Windows
XP). I have implemented the logout scheme Frank proposed in past news
(Re: Redirect user to another page after closing application) and I have
noticed that when it tries to show again the login shell, the memory
increases.

Could you please tell me what am I doing wrong?

Thanks
Gustavo

Stefan Roeck escreveu:
> Hi Oliver,
>
> as the workbench is implemented as a SessionSingleton, it should be
> disposed when the session is destroyed. If this isn't the case in your
> application there probably is a static reference to one of the session
> objects, widgets or whatever.
>
> I good starting point to find this kind of leaks besides the Workbench
> instance is the SWT Display object which exists once per session.
>
> Btw, you do you terminate your sessions?
>
> Hth,
> Stefan.
>
> Oliver Petrovski schrieb:
>> Hello,
>> I checked the memory consumption of the RAP demo application. Each new
>> session creates a new workbench that is not closed when the session
>> terminates. So each session leaves a lot of objects from package
>> org.eclipse.ui.internal after closing the session (classes Workbench*).
>> What is the reason for not cleaning up?
>>
>>
>> I tested on Suse Linux 10.2, with RAP 1.1.0 , Tomcat 5.0, JDK 1.5,
>> JProbe.
>>
>> Regards,
>> Oliver
Re: Remaining objects after closing the session of the demo rap appl. [message #100849 is a reply to message #100823] Wed, 30 July 2008 06:38 Go to previous messageGo to next message
Stefan   is currently offline Stefan Friend
Messages: 316
Registered: July 2009
Senior Member
Hi,

you don't need to dispose your session singletons manually. This is done
by the RAP infrastructure when the session is destroyed.
I am aware of three ways to destroy a session:
- Session time-out
- RWT.getRequest().getSession().setMaxInactiveInterval(smallNu mber)
- RWT.getRequest().getSession().invalidate()

This 2nd can be called from your application code. The latter cannot,
because the life cycle wouldn't finish correctly. You can add a Session
listener to all your sessions to see what's going on:

ISessionStore sessionStore = RWT.getSessionStore();
final String sessionId = sessionStore.getId();
System.out.println("Session new: " + sessionId);

sessionStore .addSessionStoreListener(new SessionStoreListener() {
public void beforeDestroy(final SessionStoreEvent event){
System.out.println("Session destroyed: " + sessionId);
}
});

I haven't tested Frank's solution but if you redirect to your login
dialog, either the existing session is re-used or, more probable, a new
session is created. Maybe, this is an explanation for the high memory
consumption, you experience.

In our RAP application, the login page is completely outside of RAP and
provided by a standard servlet (could be a static html page, as well).
On successful login, the user is redirected to the RAP application, on
logout he is redirected back to the static login page.

This doesn't work perfectly in all cases but maybe can give you some
inspiration...

Regards,
Stefan.



Gustavo schrieb:
> I'm sorry, but how do you terminate a session? I have the same problem
> as Oliver, I have implemented a subclass of SessionSingletonBase which
> also has a dispose method I call in postWindowClose method at
> WorkbenchWindowAdvisor. I have also implemented the dispose method in
> all the subclasses of ViewPart and setting to null any widget that
> composes those views. And still, when I log out my application the
> server memory usage increases instead of decreasing (Tomcat 6+Windows
> XP). I have implemented the logout scheme Frank proposed in past news
> (Re: Redirect user to another page after closing application) and I have
> noticed that when it tries to show again the login shell, the memory
> increases.
>
> Could you please tell me what am I doing wrong?
>
> Thanks
> Gustavo
>
> Stefan Roeck escreveu:
>> Hi Oliver,
>>
>> as the workbench is implemented as a SessionSingleton, it should be
>> disposed when the session is destroyed. If this isn't the case in your
>> application there probably is a static reference to one of the session
>> objects, widgets or whatever.
>>
>> I good starting point to find this kind of leaks besides the Workbench
>> instance is the SWT Display object which exists once per session.
>>
>> Btw, you do you terminate your sessions?
>>
>> Hth,
>> Stefan.
>>
>> Oliver Petrovski schrieb:
>>> Hello,
>>> I checked the memory consumption of the RAP demo application. Each
>>> new session creates a new workbench that is not closed when the
>>> session terminates. So each session leaves a lot of objects from
>>> package org.eclipse.ui.internal after closing the session (classes
>>> Workbench*).
>>> What is the reason for not cleaning up?
>>>
>>>
>>> I tested on Suse Linux 10.2, with RAP 1.1.0 , Tomcat 5.0, JDK 1.5,
>>> JProbe.
>>>
>>> Regards,
>>> Oliver
Re: Remaining objects after closing the session of the demo rap appl. [message #1630810 is a reply to message #100272] Mon, 23 February 2015 12:07 Go to previous messageGo to next message
Andreas Kowalski is currently offline Andreas KowalskiFriend
Messages: 2
Registered: February 2015
Junior Member
Has anyone found a sloution for this ?
Re: Remaining objects after closing the session of the demo rap appl. [message #1631038 is a reply to message #1630810] Mon, 23 February 2015 14:54 Go to previous message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2426
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Hi,
this topic is very old (from 2008/2009) and I believe that recent RAP
versions (2.0+) don't have such problems. Which RAP version are you
using? Do you have a simple project to demonstrate the issue?
Regards,
Ivan

--
Ivan Furnadjiev

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Previous Topic:org.eclipse.ui.propertyPages
Next Topic:RAP 1.2 ???
Goto Forum:
  


Current Time: Thu Apr 25 04:07:03 GMT 2024

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

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

Back to the top