Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Possible Memory Leak in WorkbenchStatusDialogManagerImpl
Possible Memory Leak in WorkbenchStatusDialogManagerImpl [message #1694319] Mon, 04 May 2015 12:49 Go to next message
Arye Shemesh is currently offline Arye ShemeshFriend
Messages: 37
Registered: November 2012
Member
Hi,

In my Eclipse based product, I noticed that when one of my jobs ends with an error and opens a dialog to notify the user, the job instance is still in memory even after closing the dialog.

I tracked the origin using MAT and found that the following happens:

1. JobChangeAdapter in ProgressManager creates a new StatusAdapter wrapping the job and the job ending Status.
2. WorkbenchStatusDialogManagerImpl.doAddStatusAdapter() is called with the StatusAdapter from step 1.
3. WorkbenchStatusDialogManagerImpl.dialogState is updated with the new status, with the following keys:
IStatusDialogConstants.STATUS_ADAPTERS
IStatusDialogConstants.STATUS_MODALS
IStatusDialogConstants.CURRENT_STATUS_ADAPTER (using WorkbenchStatusDialogManagerImpl.setSelectedStatusAdapter())
4. The dialog is opened. When the dialog is closed, the method WorkbenchStatusDialogManagerImpl.cleanUp() is called. It cleans the dialogState using the following keys:
IStatusDialogConstants.STATUS_ADAPTERS
IStatusDialogConstants.STATUS_MODALS

However, the dialogState still has reference to the StatusAdapter with the IStatusDialogConstants.CURRENT_STATUS_ADAPTER key.

As my job references big model objects this causes a major memory leak.
Is this the intended behavior and I'm missing something? Or should I file a bug?
The obvious fix is of course to update the cleanUp() method to remove the IStatusDialogConstants.CURRENT_STATUS_ADAPTER key from dialogState.

Thanks.
Re: Possible Memory Leak in WorkbenchStatusDialogManagerImpl [message #1694631 is a reply to message #1694319] Wed, 06 May 2015 18:14 Go to previous message
Arye Shemesh is currently offline Arye ShemeshFriend
Messages: 37
Registered: November 2012
Member
Opened a bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=466624
Previous Topic:How to list files in a bundleresource:// URL?
Next Topic:Saving java file fires two IResourceChangeEvent
Goto Forum:
  


Current Time: Tue Apr 16 23:47:01 GMT 2024

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

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

Back to the top