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 40929 - Memory Leak in Update Center Wizard
Summary: Memory Leak in Update Center Wizard
Status: VERIFIED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Autoupdate (show other bugs)
Version: 3.x
Hardware: PC Linux
: P3 blocker (vote)
Assignee: Jiri Rechtacek
URL:
Keywords: PERFORMANCE
Depends on:
Blocks: 33321 40231
  Show dependency tree
 
Reported: 2004-03-11 15:21 UTC by Marian Mirilovic
Modified: 2004-08-13 12:10 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Exported data from Optimize It after 3 invocations | cancel of Update Center Wizard - after each closing GC runs 5 times (217.17 KB, text/html)
2004-03-11 15:23 UTC, Marian Mirilovic
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Marian Mirilovic 2004-03-11 15:21:35 UTC
[nb_36](200403101830), [jdk1.4.2_03]

Test case:
- run IDE
- run GC - mark current instance count
- push Tools | Update Center
- cancel wizard
- run GC - take current instance count

Differences after 3 invocations (see attached data
from OptimizeIt):
+4 :
org.netbeans.modules.autoupdate.ServerPanel$1    
                                                    
org.netbeans.modules.autoupdate.ServerPanel      
                                                    
org.netbeans.modules.autoupdate.XMLAutoupdateType
                                                    
org.netbeans.modules.autoupdate.ServerPanel$AutoResizeTable
                                          
org.netbeans.modules.autoupdate.ServerPanel$ServerTableModel
                                        

+3 
org.openide.util.HelpCtx                         
                                                    
org.openide.WizardDescriptor$WrappedCellRenderer 
                                                    
org.openide.WizardDescriptor$ImagedPanel         
                                                    
org.openide.WizardDescriptor$WizardPanel         
                                                    
org.openide.WizardDescriptor$PropL               
                                                    
org.netbeans.modules.autoupdate.Wizard$LastPanel 
                                                    
org.netbeans.modules.autoupdate.Wizard$StartPanel
                                                    
org.netbeans.modules.autoupdate.Wizard$2         
                                                    
org.netbeans.modules.autoupdate.Wizard$3         
                                                    
org.netbeans.modules.autoupdate.Wizard$DownloadPanel
                                                 
org.netbeans.modules.autoupdate.FirstPanel$2     
                                                    
org.netbeans.modules.autoupdate.FirstPanel$3     
                                                    
org.netbeans.modules.autoupdate.Wizard$1         
                                                    
org.netbeans.modules.autoupdate.Wizard           
                                                    
org.netbeans.modules.autoupdate.Wizard$ConfigPanel
                                                   
org.netbeans.modules.autoupdate.FirstPanel$1     
                                                    
org.netbeans.modules.autoupdate.Wizard$SelectPanel
                                                   
org.netbeans.modules.autoupdate.Wizard$PropPanel 
                                                    
org.openide.WizardDescriptor$3                   
                                                    
org.openide.WizardDescriptor                     
                                                    
org.openide.WizardDescriptor$Listener
Comment 1 Marian Mirilovic 2004-03-11 15:23:04 UTC
Created attachment 13949 [details]
Exported data from Optimize It after 3 invocations | cancel of Update Center Wizard - after each closing GC runs 5 times
Comment 2 _ ttran 2004-03-11 16:11:28 UTC
not a showstopper, the Update Center dialog is not invoked repeatedly
in one IDE run.  Target -> PromoD
Comment 3 Jan Chalupa 2004-03-31 11:31:18 UTC
Not urgent for 3.6. -> P3
Comment 4 Antonin Nebuzelsky 2004-05-10 16:06:14 UTC
Checking in Wizard.java;
/cvs/autoupdate/src/org/netbeans/modules/autoupdate/Wizard.java,v  <--
 Wizard.java
new revision: 1.68; previous revision: 1.67
done
Checking in ServerPanel.java;
/cvs/autoupdate/src/org/netbeans/modules/autoupdate/ServerPanel.java,v
 <--  ServerPanel.java
new revision: 1.14; previous revision: 1.13
done
Checking in UpdatePanel.java;
/cvs/autoupdate/src/org/netbeans/modules/autoupdate/UpdatePanel.java,v
 <--  UpdatePanel.java
new revision: 1.100; previous revision: 1.99
done
Comment 5 Antonin Nebuzelsky 2004-05-10 18:59:15 UTC
Checking in WizardDescriptor.java;
/cvs/openide/src/org/openide/WizardDescriptor.java,v  <-- 
WizardDescriptor.javanew revision: 1.99; previous revision: 1.98
done

The AU wizard's UI components can still be held temporarily in memory
after the wizard is closed. This can be caused either by
NodeRenderer's static sharedInstance -> .. -> HtmlRendererImpl (this
is eliminated next time a renderer is used), or via last key pressed
(a static field of a keyboard manager, I don't remember the classname
now) which references a UI component via its source field (this is
eliminated next time a key is pressed). :o)

Closing as fixed.
Comment 6 _ rkubacki 2004-05-11 08:40:02 UTC
The latter case is fixed AFAIK:
core/windows/src/org/netbeans/core/windows/ShortcutAndMenuKeyEventProcessor.java
revision 1.6
date: 2004/05/07 16:13:40;  author: pkuzel;  state: Exp;  lines: +10 -5
This small cache was able to reference several MBs of data, until user
pressed next monitored key.

Isn't the former one bigger problem that should be fixed in
HtmlRendererImpl? I don't like solution with too many weak listeners
that are usualy workarounds if we are not able to find better solution.
Comment 7 Antonin Nebuzelsky 2004-05-11 09:48:40 UTC
I like the weak listeners. They are clean and they work. And if there
are just several instances used at a moment, I don't see a problem
with them. If they were created in a huge amount for a very short
lifetime, I'd agree that they would be too much overhead. But I don't
see this issue here. Anyway, feel free to provide a different solution
if you like.

The issue with HtmlRendererImpl should be solved. (It is not solved by
the changes integrated here.) But IMO it does not prevent this bug
from being closed. AU wizard is not increasingly leaking anymore, it
just can stay there for some time after it is closed. Until the
renderer is used again.
Comment 8 Marian Mirilovic 2004-08-02 07:18:04 UTC
verified in [nb_dev](200408011800)