Bug 227227 - Switching between elements too often cause netbeans freeze for a while and cpu,memory usage surge.
Switching between elements too often cause netbeans freeze for a while and cp...
Status: VERIFIED FIXED
Product: cnd
Classification: Unclassified
Component: Navigation
7.3
PC Windows 7
: P2 (vote)
: 7.3.1
Assigned To: Vladimir Voskresensky
issues@cnd
73patch2-verified cnd-clone
:
: 226807 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-03-09 05:23 UTC by hooluupog
Modified: 2013-07-17 07:16 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description hooluupog 2013-03-09 05:23:00 UTC
To reproduce it:
1)Open a cpp file with many functions and classes in a project;
2)Double-click #defines, variables, functions, etc in navigator window time and time again.
Finally,netbeans will freeze for a while and memory,cpu usages become very high.
Comment 1 Vladimir Voskresensky 2013-03-13 06:08:29 UTC

*** This bug has been marked as a duplicate of bug 225449 ***
Comment 2 Jaroslav Tulach 2013-03-27 13:43:42 UTC
getLookup() method should always return the same instance, not create new one on every invocation.

# This patch file was generated by NetBeans IDE
# It uses platform neutral UTF-8 encoding and \n newlines.
--- <html>NavigatorComponent.java (<b>Jan 23, 2013 7:05:07 PM</b>)</html>
+++ <html><b>Current File</b></html>
@@ -147,6 +147,13 @@
         }
     }
     
+    class N extends ProxyLookup {
+        void update(Lookup... arr) {
+            setLookups(arr);
+        }
+    }
+    N n = new N();
+    
     @Override
     public Lookup getLookup() {
         synchronized(lock) {
@@ -154,10 +161,11 @@
                 return getPanelUI().getLookup();
             } else {
                 if (getPanelUI().getLookup().lookup(Node.class) == null) {
-                    return new ProxyLookup(getPanelUI().getLookup(), Lookups.fixed(curData.getNodeDelegate(), curData, curData.getPrimaryFile()));
+                    n.update(getPanelUI().getLookup(), Lookups.fixed(curData.getNodeDelegate(), curData, curData.getPrimaryFile()));
                 } else {
-                    return new ProxyLookup(getPanelUI().getLookup(), Lookups.fixed(curData, curData.getPrimaryFile()));
+                    n.update(getPanelUI().getLookup(), Lookups.fixed(curData, curData.getPrimaryFile()));
                 }
+                return n;
             }
         }
     }
Comment 3 Vladimir Voskresensky 2013-03-28 05:05:17 UTC
Thanks, Jarda:
http://hg.netbeans.org/cnd-main/rev/15c8e2da0550
Comment 4 Quality Engineering 2013-03-29 02:08:33 UTC
Integrated into 'main-golden', will be available in build *201303282300* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/15c8e2da0550
User: Vladimir Voskresensky <vv159170@netbeans.org>
Log: fixed (by Jarda) #227227 Switching between elements too often cause netbeans freeze for a while and cpu,memory usage surge.
- use one lookup instance
Comment 5 Vladimir Voskresensky 2013-04-09 09:58:02 UTC
verified
Comment 6 soldatov 2013-05-14 11:01:27 UTC
Verified in NetBeans 7.3 patch 2
Comment 7 Jan Peska 2013-07-17 07:16:19 UTC
*** Bug 226807 has been marked as a duplicate of this bug. ***


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo