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 253374

Summary: Memory leakage due as bugtracking module does not release some object such as QueryTopComponent
Product: connecteddeveloper Reporter: jijwang
Component: Issuetracking FrameworkAssignee: Tomas Stupka <tstupka>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P2    
Version: 8.1   
Hardware: PC   
OS: Windows 7   
Issue Type: DEFECT Exception Reporter:
Attachments: bugzilla query memory profile

Description jijwang 2015-07-08 22:33:01 UTC
Created attachment 154533 [details]
bugzilla query memory profile

Perform memory profile on bugzilla for the following cases separately:
1) Open a new query, execute it and then delete it without any saving;
2) Create a new query, execute it and then delete the query.

In both case, related QueryTopComponent (which creates BugzillaQuery instance), BugzillaQuery (which creates QueryController), QueryController (which creates QueryPanel), QueryPanel and its containing attributes are not released.

The bugtracking module should release QueryTopComponent and also detect if the BugzillaQuery should be deleted. If it is not saved, then it should release the BugzillaQuery as well as other related objects (QueryController, Query Panel, QueryParameter etc)

For saved query, when it is removed, the bugtracking module should release corresponding BugzillaQuery and other related objects.
Comment 1 Tomas Stupka 2015-07-19 17:29:00 UTC
fixed in jet-main #ee362dffa0ea
Comment 2 Quality Engineering 2015-07-21 01:20:17 UTC
Integrated into 'main-silver', will be available in build *201507210001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/ee362dffa0ea
User: Tomas Stupka <tstupka@netbeans.org>
Log: Issue #253374 - Memory leakage due as bugtracking module does not release some object such as QueryTopComponent
Comment 3 jijwang 2015-08-12 00:05:34 UTC
The fix did not seem to address test case 1). I still see QueryTopComponent in profiler's snapshot after running GC. The QueryTopComponent is allocated in org.netbeans.modules.bugtracking.ui.query.QueryAction.openQuery(). It is supposed to be deallocated in QueryAction.closeQuery() but I did not see that method is called. In the run() inside closeQuery(), it is also better to put tc = null after tc.close()
Comment 4 Tomas Stupka 2015-08-27 13:30:22 UTC
could not reproduce.

QueryAction holds no reference to QueryTopComponent, it merely opens it.
.closeQuery() is meant to close the TC for a specific query, not to deallocate.

if you have a profiler snapshot, please attach it to the issue