Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Reopening the workbench without restarting RCP platform - Kiosk mode
Reopening the workbench without restarting RCP platform - Kiosk mode [message #436064] Tue, 30 August 2005 17:40 Go to next message
Alex Sanielevici is currently offline Alex SanieleviciFriend
Messages: 2
Registered: July 2009
Junior Member
I'm planning an RCP application to be used in a kiosk mode. Closing the
workbench should bring it right back as soon as possible, or in my case
should bring back the login dialog shown by the IPlatformRunnable before
it opens the workbench.

When looping in the IPlatformRunnable over
PlatformUI.createAndRunWorkbench(), I see this leaks quite a bit of
memory... Whether the user closes the workbench using the close button, or
it is closed programmatically via PlatformUI.getWorkbench().close(), it
seems the Workbench resources never get cleaned up. The memory used by the
javaw process doubles after about 100 workbench open/close cycles on a
simple app.

I'm trying to avoid returning IPlatformRunnable.EXIT_RESTART from the
IPlatformRunnable, as this would unnecessarily restart the entire platform
and reload of all the plugin manifests, which takes time.

Is there any way to either:

1. Completely clean up / dispose the workbench object after it is closed
and PlatformUI.createAndRunWorkbench() returns to the IPlatformRunnable.

2. Reuse the resources of the same workbench once again by reopening it
rather than creating a new one as PlatformUI.createAndRunWorkbench() seems
to do regardless of an non-null PlatformUI.getWorkbench().

Might this be a bug (leak) in PlatformUI.createAndRunWorkbench() or
improper disposal as triggered from the workbench's close() method?

Thanks! -- Alex.
Re: Reopening the workbench without restarting RCP platform - Kiosk mode [message #436173 is a reply to message #436064] Thu, 01 September 2005 15:57 Go to previous messageGo to next message
Boris Bokowski is currently offline Boris BokowskiFriend
Messages: 272
Registered: July 2009
Senior Member
Please enter a bug against Platform UI. Please include the code "outside" of
PlatformUI.createAndRunWorkbench if possible (or describe in detail what you
are doing). Have you used a heap analyzer to see who causes the leak? Do
you have any static variables (or objects that are referenced to from the
code that is "outside") that might refer to the Workbench, directly or
indirectly?
Boris

"Alex Sanielevici" <alex@sanielevici.com> wrote in message
news:204474f3df8b4a7e9a9f52fe31e636a0$1@www.eclipse.org...
> I'm planning an RCP application to be used in a kiosk mode. Closing the
> workbench should bring it right back as soon as possible, or in my case
> should bring back the login dialog shown by the IPlatformRunnable before
> it opens the workbench.
>
> When looping in the IPlatformRunnable over
> PlatformUI.createAndRunWorkbench(), I see this leaks quite a bit of
> memory... Whether the user closes the workbench using the close button, or
> it is closed programmatically via PlatformUI.getWorkbench().close(), it
> seems the Workbench resources never get cleaned up. The memory used by the
> javaw process doubles after about 100 workbench open/close cycles on a
> simple app.
>
> I'm trying to avoid returning IPlatformRunnable.EXIT_RESTART from the
> IPlatformRunnable, as this would unnecessarily restart the entire platform
> and reload of all the plugin manifests, which takes time.
>
> Is there any way to either:
>
> 1. Completely clean up / dispose the workbench object after it is closed
> and PlatformUI.createAndRunWorkbench() returns to the IPlatformRunnable.
>
> 2. Reuse the resources of the same workbench once again by reopening it
> rather than creating a new one as PlatformUI.createAndRunWorkbench() seems
> to do regardless of an non-null PlatformUI.getWorkbench().
>
> Might this be a bug (leak) in PlatformUI.createAndRunWorkbench() or
> improper disposal as triggered from the workbench's close() method?
>
> Thanks! -- Alex.
>
Re: Reopening the workbench without restarting RCP platform - Kiosk mode [message #436184 is a reply to message #436173] Thu, 01 September 2005 17:43 Go to previous message
Alex Sanielevici is currently offline Alex SanieleviciFriend
Messages: 2
Registered: July 2009
Junior Member
The simplest way to demonstrate this: use the Hello RCP example generated
by the PDE, and modify the IPlatformRunnable.run() to loop over the
creation of the workbench, as shown below. Every time the workbench
appears, close it with the close box (or with an action calling
PlatformUI.getWorkbench().close()). The javaw size will increase each
time.

Which heap analyzer to you recommend for this purpose?

I'll create a bugzilla entry for this as there doesn't seem to be a way to
clean up the old workbench or to reopen it while reusing the old one.

public Object run(Object args) throws Exception {
Display display = PlatformUI.createDisplay();
try {

while (true)
{
int returnCode = PlatformUI.createAndRunWorkbench(display, new
ApplicationWorkbenchAdvisor());
if (returnCode == PlatformUI.RETURN_RESTART) {
return IPlatformRunnable.EXIT_RESTART;
}
//return IPlatformRunnable.EXIT_OK;
}

} finally {
display.dispose();
}
}
Previous Topic:Welcome View Problems
Next Topic:RCP Editor Part preferences
Goto Forum:
  


Current Time: Sun Dec 08 15:54:34 GMT 2024

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

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

Back to the top