Bug 116723 - JSP editor is leaking memory
Summary: JSP editor is leaking memory
Status: CLOSED INVALID
Alias: None
Product: WTP Source Editing
Classification: WebTools
Component: jst.jsp (show other bugs)
Version: 1.0   Edit
Hardware: PC Windows XP
: P3 critical (vote)
Target Milestone: ---   Edit
Assignee: David Williams CLA
QA Contact:
URL:
Whiteboard:
Keywords: performance
Depends on:
Blocks:
 
Reported: 2005-11-16 15:45 EST by Jeffrey Liu CLA
Modified: 2005-11-29 00:48 EST (History)
0 users

See Also:


Attachments
Testcase (1.17 MB, application/x-zip-compressed)
2005-11-16 15:47 EST, Jeffrey Liu CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jeffrey Liu CLA 2005-11-16 15:45:06 EST
I have one testcase that opens/closes the JSP editor 10 times, one that 
opens/closes the editor 25 times and one that opens/closes the editor 100 
times. Results below:

10 times:

  Used Java Heap: 29.87M
  Working Set: 43.69M
  Committed: 54.24M
  Working Set Peak: 43.7M
  Elapsed Process: 29.98 s
  Kernel time: 2.97 s
  Page Faults: 13.28K
  CPU Time: 28.66 s
  GDI Objects: 13

25 times:

  Used Java Heap: 74.3M
  Working Set: 88.51M
  Committed: 84.5M
  Working Set Peak: 88.52M
  Elapsed Process: 1.11 m
  Kernel time: 7.21 s
  Page Faults: 25.6K
  CPU Time: 1.08 m
  GDI Objects: 13

100 times:

  Used Java Heap: 276.34M
  Working Set: 291.51M
  Committed: 359.42M
  Working Set Peak: 291.53M
  Elapsed Process: 4.5 m
  Kernel time: 27.98 s
  Page Faults: 82.99K
  CPU Time: 4.06 m
  GDI Objects: 13

Notice that the heap size grows as the number of open/close increases. I'll 
submit a testcase.
Comment 1 Jeffrey Liu CLA 2005-11-16 15:47:43 EST
Created attachment 30096 [details]
Testcase

Look for the following JUnit testcases:

org.eclipse.jst.jsp.ui.tests.performance.scalability.RepeatOpenEditorx10TestCase

org.eclipse.jst.jsp.ui.tests.performance.scalability.RepeatOpenEditorx25TestCase

org.eclipse.jst.jsp.ui.tests.performance.scalability.RepeatOpenEditorx100TestCase
Comment 2 Jeffrey Liu CLA 2005-11-17 16:01:18 EST
Testcase check into HEAD
Comment 3 Phillip Avery CLA 2005-11-21 16:27:17 EST
After profiling with YourKit, I'm not seeing anywhere near the magnitude
of the leak detailed here.  It seems that the test results may be somewhat misleading.

We suspect more needs to be done to manage Display thread events, as the base
does with their open editor tests.  Is "joinBackgroundJobs()" accomplishing the same thing as "EditorTestHelper#runEvenQueue()"?  Maybe we should model our tests after  "org.eclipse.jdt.text.tests.performance.OpenEditorTest"

I did find a couple other leaks (content assist processors,and java text tools)
but they're small (looks like < 1K for those per open/close), and I've opened 
bugzillas for them.

I'm marking as invalid unless we have a concrete example of where the editor is leaking badly as indicated.
Comment 4 Jeffrey Liu CLA 2005-11-29 00:48:03 EST
Events such as the draw workbench events are not being run, which led to the OOM exception. Testcase fixed.