This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 124713

Summary: Memory leak in some refactoring cache
Product: editor Reporter: Jaroslav Tulach <jtulach>
Component: RefactoringAssignee: issues@java <issues>
Status: RESOLVED FIXED    
Severity: blocker Keywords: PERFORMANCE, TEST
Priority: P2    
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:
Bug Depends on:    
Bug Blocks: 121855    

Description Jaroslav Tulach 2008-01-04 15:10:48 UTC
After running test described in issue 121855 one gets memory leak:


private static org.netbeans.modules.refactoring.spi.impl.UndoManager 
org.netbeans.modules.refactoring.spi.impl.UndoManager.instance->
org.netbeans.modules.refactoring.spi.impl.UndoManager@1c86638-fileObjectToCES->
java.util.HashMap@ec0608-table->
[Ljava.util.HashMap$Entry;@fb8863-[7]->
java.util.HashMap$Entry@f612ab-value->
org.netbeans.modules.java.JavaDataObject$JavaEditorSupport@10c34c9-obj->
org.netbeans.modules.java.JavaDataObject@1e131b5-nodeDelegate->
org.netbeans.modules.java.JavaNode@1e2173f-status->
org.netbeans.spi.project.support.ant.GlobFileBuiltQuery$StatusImpl@8ae265-this$0->
org.netbeans.spi.project.support.ant.GlobFileBuiltQuery@590c66-eval->
org.netbeans.spi.project.support.ant.PropertyUtils$SequentialPropertyEvaluator@158b772-listeners->
java.util.ArrayList@2d41f8-elementData->
[Ljava.lang.Object;@c85974-[12]->
org.netbeans.modules.java.j2seproject.MainClassUpdater@8bfb0a-project->
org.netbeans.modules.java.j2seproject.J2SEProject@1ad37f6
Comment 1 Jan Becicka 2008-01-04 15:34:02 UTC
Jardo, this is not memory leak.
UndoManager holds this data intentionaly as long as Refactoring Undo is available.

Maybe I can clear UndoManager when projects are being closed...


Comment 2 Jaroslav Tulach 2008-01-06 21:07:42 UTC
Right now it looks a bit like memory leak. How to clear the Refactoring Unco cache? Type something in editor? That is 
had to do when every project and source file is closed. Any other, simpler gesture to clear it? If not, then I agree 
it is good idea to clear the undo when some project is closed.

Comment 3 Jan Becicka 2008-01-24 14:42:00 UTC
Fixed I hope.

Checking in src/org/netbeans/modules/refactoring/spi/impl/UndoManager.java;
/cvs/refactoring/api/src/org/netbeans/modules/refactoring/spi/impl/UndoManager.java,v  <--  UndoManager.java
new revision: 1.9; previous revision: 1.8
done
Checking in nbproject/project.xml;
/cvs/refactoring/api/nbproject/project.xml,v  <--  project.xml
new revision: 1.14; previous revision: 1.13
done