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

Bug 285300

Summary: EclipseDebugTrace objects can pin class loaders
Product: [Eclipse Project] Equinox Reporter: Thomas Watson <tjwatson>
Component: FrameworkAssignee: Thomas Watson <tjwatson>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: tjbishop
Version: 3.5   
Target Milestone: 3.6 M1   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:
Attachments:
Description Flags
patch none

Description Thomas Watson CLA 2009-07-31 12:28:00 EDT
EclipseDebugTrace contains a traceClass instance field of type Class.  Upon inspection it appears we could use a String for the class name instead.  Using a Class object here is bad because it will cause the Class to be pinned for GC which will prevent a class loader from being GC'ed if a bundle is uninstalled or refreshed.

I think the constructor of EclispeDebugTrace should store the name of the traceClass instead of the actual Class object.
Comment 1 Thomas Watson CLA 2009-07-31 12:28:58 EDT
I'll work on a fix for M1.
Comment 2 Thomas Watson CLA 2009-07-31 18:02:29 EDT
Created attachment 143197 [details]
patch

Fix plus new test.

Troy, I created one new test (testTraceFile01) that reads the trace file and parses it to confirm the content.  Does this seem like a reasonable way to test this?  Can you assist in creating some more tests to cover the methods of DebugTrace?
Comment 3 Thomas Watson CLA 2009-07-31 18:08:12 EDT
I released the fix and new test.  I opened bug 285341 to create more testcases for DebugTrace.