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 224856 - Slow response when editing Java code
Summary: Slow response when editing Java code
Status: RESOLVED FIXED
Alias: None
Product: db
Classification: Unclassified
Component: Code (show other bugs)
Version: 7.2
Hardware: PC Windows XP
: P3 normal (vote)
Assignee: Jaroslav Havlin
URL:
Keywords:
: 224855 (view as bug list)
Depends on: 224954
Blocks:
  Show dependency tree
 
Reported: 2013-01-14 15:23 UTC by pbradley
Modified: 2013-01-18 02:51 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Profile of IDE during slowness (221.34 KB, application/octet-stream)
2013-01-14 15:23 UTC, pbradley
Details
Profile of IDE during slowness (81.97 KB, application/octet-stream)
2013-01-14 18:58 UTC, pbradley
Details
Profile of IDE during slowness (173.19 KB, application/octet-stream)
2013-01-15 15:24 UTC, pbradley
Details
Profile of IDE during slowness (90.47 KB, application/octet-stream)
2013-01-15 19:35 UTC, pbradley
Details
A possible fix. (1.35 KB, patch)
2013-01-16 12:37 UTC, Jan Lahoda
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description pbradley 2013-01-14 15:23:57 UTC
Created attachment 130189 [details]
Profile of IDE during slowness

I have two projects open, a web service project and a web application. I have an instance of Glassfish 3.1.2 in the services tab. I have disabled "deploy on save" for both projects since this can slow things down significantly. 

I randomly encounter unexplained slow downs (unrelated to scanning of projects); In this case, I was editing Java code. Hopefully the attached profile will provide some insight into what was happening.
Comment 1 pbradley 2013-01-14 18:56:48 UTC
Submitting a profile from another occurrence, this time the Xmx option has been set to 1024m instead of 512m as was previously the case.
Comment 2 pbradley 2013-01-14 18:58:31 UTC
Created attachment 130201 [details]
Profile of IDE during slowness
Comment 3 pbradley 2013-01-14 19:12:55 UTC
I have taken a heap dump of netbeans shortly after the second profile was taken. The CPU was still at 100% during the heap dump so the problem was still persisting at that point. I can't upload the heap dump due to the size but if you would like me to make it available to you, please contact me and I will.

Phil
Comment 4 pbradley 2013-01-15 14:47:07 UTC
*** Bug 224855 has been marked as a duplicate of this bug. ***
Comment 5 pbradley 2013-01-15 15:24:25 UTC
Created attachment 130245 [details]
Profile of IDE during slowness
Comment 6 Tomas Hurka 2013-01-15 15:31:31 UTC
According to the fisrt snapshot, it looks like a lot of time is spent in 
org.netbeans.modules.java.hints.spiimpl.hints.HintsInvoker.computeHints() method both in 'Editor Parsing Loop' and 'org.netbeans.api.progress.ProgressUtils' threads. Reassigning to java/hints for further evaluation.
Comment 7 Jan Lahoda 2013-01-15 15:52:15 UTC
The heap dump might be useful - could you please try to upload it here:
http://deadlock.netbeans.org/hudson/job/upload/

Thanks.
Comment 8 pbradley 2013-01-15 16:59:21 UTC
I have uploaded this as build id 136. Note that I compressed the file with gzip before I uploaded it. I notice that Hudson zips the file on the server side so you may need to decompress the resulting file with gzip before you can use it.
Comment 9 pbradley 2013-01-15 19:35:29 UTC
Created attachment 130258 [details]
Profile of IDE during slowness

Hope I'm not overloading this with snapshots, just hoping that enough data will allow this to be narrowed down to a specific cause.
Comment 10 Jan Lahoda 2013-01-16 12:36:05 UTC
Thanks for the heap dump. It seems to me that the biggest problem is that there are almost 149166 instances of org.netbeans.modules.db.explorer.node.NodeRegistry, which the probably holds more objects, leading to a lot of memory retained through it. These appear to be held though a lookup listener. I will attach a possible patch.

The hints maybe could be made faster (and produce less garbage) - filled #224954 for that.
Comment 11 Jan Lahoda 2013-01-16 12:37:32 UTC
Created attachment 130279 [details]
A possible fix.
Comment 12 Jaroslav Havlin 2013-01-17 14:47:06 UTC
(In reply to comment #11)
> Created attachment 130279 [details]
> A possible fix.
Thank you very much for the patch.
Applied as http://hg.netbeans.org/core-main/rev/32bc4f6809be
Comment 13 Quality Engineering 2013-01-18 02:51:12 UTC
Integrated into 'main-golden', will be available in build *201301180001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/32bc4f6809be
User: Jaroslav Havlin <jhavlin@netbeans.org>
Log: #224856: NodeRegistry uses weak lookup listeners