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 89844 - NbClipboard strong-references last hidden window (memory leak)
Summary: NbClipboard strong-references last hidden window (memory leak)
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 5.x
Hardware: All All
: P3 blocker (vote)
Assignee: Jaroslav Tulach
URL:
Keywords: PERFORMANCE
Depends on:
Blocks:
 
Reported: 2006-11-22 12:57 UTC by Petr Nejedly
Modified: 2008-12-22 21:12 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Petr Nejedly 2006-11-22 12:57:08 UTC
There is a JDK problem workaround in NbClipboard that tracks the last
deactivated component and checks whether it is the same on WINDOW_ACTIVATED.
This causes a medium leak that keeps last used dialog in memory until next
dialog is used.
After startup, it can also referenc splash screen this way (600KB) for extended
period of time.
The component could IMHO be either referenced weakly, or (probably better and
easier) cleared on next WINDOW_ACTIVATED event.
Assigning to Yarda, ccing Trung, they know most about the code.
I can fix it myself if you aggree with the (latter) proposed solution.
Comment 1 Jaroslav Tulach 2006-11-23 15:01:55 UTC
I guess use of weak reference is safer fix.
Comment 2 Jaroslav Tulach 2006-11-23 16:04:26 UTC
Feel free to improve, if you want...

Checking in test/unit/src/org/netbeans/core/NbClipboardTest.java;
/shared/data/ccvs/repository/core/test/unit/src/org/netbeans/core/NbClipboardTest.java,v  
<--  NbClipboardTest.java
new revision: 1.3; previous revision: 1.2
done
Checking in src/org/netbeans/core/NbClipboard.java;
/shared/data/ccvs/repository/core/src/org/netbeans/core/NbClipboard.java,v  
<--  NbClipboard.java
new revision: 1.32; previous revision: 1.31