Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 275332

Summary: Possible memory leak after session invalidate
Product: [RT] RAP Reporter: Loïc Bertholet <loic.bertholet>
Component: RWTAssignee: Project Inbox <rap-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P1    
Version: 1.2   
Target Milestone: 1.2 RC1   
Hardware: All   
OS: All   
Whiteboard:

Description Loïc Bertholet CLA 2009-05-07 12:27:02 EDT
Environment : RAP 1.2-M6 and CVS Head / Tomcat, Jetty / FF 3.0.9, IE 7 / Window XP

When session is unvalidated (thanks to time out or RWT.getSessionStore().getHttpSession().setMaxInactiveInterval(1)) the Workbench is closed thanks to a SessionStoreListener.

But the process is not exactly the same as when it is closed thanks to the workbench red cross button : the ServiceContext is not disposed thanks to ContextProvider.disposeContext() and so the state info reference is not released.

As only the terminated UI thread holds a reference to it, it should be garbage collected. But if the application uses BIRT, it indirectly uses EMF XMLTypeUtil class which sometimes holds a static reference on this terminated UI thread. So it is not garbage collected and as the ServiceContext is not disposed and nothing of the application is garbage collected (state info hold a reference to the Workbench).

I was wondering if there was a reason not calling ContextProvider.disposeContext() at the end of UIThread.processShutdown(), just like it is done at the end of RWTDelegate.doPost().
It is the only workaround I found but I don't know if it may involve regression.
Comment 1 Rüdiger Herrmann CLA 2009-05-08 12:10:59 EDT
UIThread.processShutdown() now disposes the context.
Changes are in CVS HEAD