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 81760 - Print Action leads to memory leaks
Summary: Print Action leads to memory leaks
Status: CLOSED FIXED
Alias: None
Product: utilities
Classification: Unclassified
Component: Print (show other bugs)
Version: 5.x
Hardware: All All
: P2 blocker (vote)
Assignee: Vladimir Yaroslavskiy
URL:
Keywords: PERFORMANCE
Depends on:
Blocks:
 
Reported: 2006-08-03 00:30 UTC by Chris Webster
Modified: 2006-08-31 01:55 UTC (History)
0 users

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 Chris Webster 2006-08-03 00:30:43 UTC
The Action class org.netbeans.modules.print.impl.action.Action has a
myPrintProvider instance variable which is set in the enable method and then
later used in the performAction method. This pattern triggers the following
scenario:

1. Shutdown the IDE with a file open (such as schema). 
2. Restart the IDE, during restart the print action (from file menu determines
whether it enables and thus stores the print provider). This stores the document
and other references into the schema model until the next time enable is called.
The print preview action is called more frequently so the leak is shorter, but
the print action could potentially only be enabled from the file menu and thus
hold on to the print provider for a longer time. 

The resolution is not to cache the print provider in the enable method and just
compute the provider when the perform action is called. This will eliminate the
leak.
Comment 1 Vladimir Yaroslavskiy 2006-08-03 08:16:11 UTC
fixed.