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

Bug 274017

Summary: Memory leak in JobManagerAdapter (1)
Product: [RT] RAP Reporter: Loïc Bertholet <loic.bertholet>
Component: WorkbenchAssignee: Project Inbox <rap-inbox>
Status: RESOLVED DUPLICATE QA Contact:
Severity: normal    
Priority: P2 CC: irbull
Version: 1.2   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description Loïc Bertholet CLA 2009-04-28 08:23:08 EDT
Environment : RAP 1.2-M6 / Tomcat, Jetty / FF 3.0.9, IE 7 / Window XP

Steps to reproduce:
* Create and Run a Job on for example an EditorPart
* Open this EditorPart an make the Job running.
* The Job is put in the JobManagerAdapter Map named jobs and is not removed until the user session ends. It creates memory leak because when the EditorPart is closed, as the Job is still contained by the JobManagerAdapter, the EditorPart (and all its fields) can't be garbage collected.

Expected:
The Job should be removed from the JobManagerAdapter jobs when it is done.
But the JobManagerAdapter done method has the following code :
        if( !job.shouldSchedule() ) {
          jobs.remove( job );
        }
As Job.shouldSchedule() always returns true, it is never removed.

A workaround is to override the created Job souldSchedule() method but as this behavior differs from RCP, I consider it as a bug.
Comment 1 Ian Bull CLA 2009-07-10 14:25:30 EDT

*** This bug has been marked as a duplicate of bug 281289 ***