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 199839 - Runaway task using 100% cpu
Summary: Runaway task using 100% cpu
Status: RESOLVED DUPLICATE of bug 199773
Alias: None
Product: javaee
Classification: Unclassified
Component: Persistence (show other bugs)
Version: 7.1
Hardware: PC Windows 7 x64
: P1 normal (vote)
Assignee: Sergey Petrov
URL:
Keywords: PERFORMANCE
Depends on:
Blocks:
 
Reported: 2011-07-01 20:31 UTC by _ gtzabari
Modified: 2011-07-06 15:27 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
thread dump (27.37 KB, text/plain)
2011-07-01 20:31 UTC, _ gtzabari
Details
cpu sampling taken using VisualVM (10.01 KB, application/octet-stream)
2011-07-01 20:32 UTC, _ gtzabari
Details

Note You need to log in before you can comment on or make changes to this bug.
Description _ gtzabari 2011-07-01 20:31:32 UTC
Product Version: NetBeans IDE Dev (Build 201106280600)
Java: 1.7.0; Java HotSpot(TM) 64-Bit Server VM 21.0-b17
(JDK build 1.7.0-b147)
System: Windows 7 version 6.1 running on amd64; Cp1252; en_US (nb)

Something seems to be wrong in the latest build. After using the IDE for about 2 minutes some runaway task begins consuming 100% cpu and functionality like Fix Imports or Refactoring block waiting for a "lengthy operation" to complete.

I'm going to attach a thread dump and saved CPU Sampling I took using VisualVM. I suspect the runaway task is org.netbeans.api.lexer.TokenSequence.checkModCount()

I am flagging this as high priority because it requires me to restart the IDE every two minutes.
Comment 1 _ gtzabari 2011-07-01 20:31:49 UTC
Created attachment 109200 [details]
thread dump
Comment 2 _ gtzabari 2011-07-01 20:32:06 UTC
Created attachment 109201 [details]
cpu sampling taken using VisualVM
Comment 3 _ gtzabari 2011-07-01 20:45:48 UTC
To reproduce, use the IDE for a bit (editing code, compiling, etc) then switch away to another task (Microsoft Word in my case), then switch back and continue coding. A few seconds later you will notice a runaway task eating 100% cpu.
Comment 4 _ gtzabari 2011-07-01 22:43:19 UTC
Another clue: Netbeans 7.0.1 RC1 does not exhibit this bug.
Comment 5 Marian Mirilovic 2011-07-04 11:06:32 UTC
reassign to perf. team for first evaluation
Comment 6 Tomas Hurka 2011-07-06 09:44:42 UTC
This issue probably depends on the particular project and source file. The steps to reproduce are too generic. This problem definitely does not occur for any project and any source file. Can you provide better steps to reproduce? 
From the nps file, it looks like there is a endless loop in 
org.netbeans.modules.j2ee.persistence.editor.completion.CCParser.findAnnotationStart()
Comment 7 Sergey Petrov 2011-07-06 15:14:42 UTC
prior to investigation, may it be a duplicate of issue 199773?
Comment 8 Sergey Petrov 2011-07-06 15:27:01 UTC
at least thread dump have 
org.netbeans.modules.j2ee.persistence.editor.completion.CCParser.findAnnotationStart(CCParser.java:263)
and it was the reason for infinite loop.

*** This bug has been marked as a duplicate of bug 199773 ***