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 |
Eclipse User |
|
|
|
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 |
Stefan 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 |
Eclipse User |
|
|
|
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 |
Stefan 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
|
|
| | |
Goto Forum:
Current Time: Thu Apr 25 04:07:03 GMT 2024
Powered by FUDForum. Page generated in 0.03422 seconds
|