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 246821 - 2 cores 100% utilization after search in editor
Summary: 2 cores 100% utilization after search in editor
Status: RESOLVED INCOMPLETE
Alias: None
Product: editor
Classification: Unclassified
Component: Search (show other bugs)
Version: 8.1
Hardware: All All
: P2 normal (vote)
Assignee: Milutin Kristofic
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-09-02 11:38 UTC by Vladimir Voskresensky
Modified: 2015-03-16 13:53 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
snapshot (359.00 KB, application/octet-stream)
2014-09-02 11:38 UTC, Vladimir Voskresensky
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Vladimir Voskresensky 2014-09-02 11:38:19 UTC
I had to restart IDE after use of "search in editor", because 2 cores are used by inifinite loops of org.netbeans.modules.editor.search.DocumentFinder.findBlocks.
I will attach npss
Comment 1 Vladimir Voskresensky 2014-09-02 11:38:57 UTC
Created attachment 148999 [details]
snapshot
Comment 2 Vladimir Voskresensky 2014-09-02 11:42:07 UTC
Unfortunately I don't know which regexp I used.
May be one from history combo may help (or it's part while I was typing it):
----------history------
!.*org
!.org
!(.*)org
!m
!(\s)+org
---Array based---
SourceLocation::<init>
-------------------------
sometimes I used regexp based mode; sometimes Case Sensitive mode
Comment 3 Milutin Kristofic 2014-09-05 15:46:31 UTC
Thank you, it's weird, since I implemented https://netbeans.org/bugzilla/show_bug.cgi?id=244203 to protect against it and it doesn't work. Thread should be killed after 5 seconds. I am investigating
Comment 4 Milutin Kristofic 2014-09-05 15:47:51 UTC
Unfortunately there are regexp with high time complexity.
Comment 5 Milutin Kristofic 2014-09-05 16:29:49 UTC
I am trying to reproduce, but I get always TimeoutException, when file is too big or expression to complex?

Vladimir, can you help me with messages.log if there are any timeoutexceptions? I see that Document.charAt is really slow, what was the size of document and was it on network disk, can this be culprit, that io operation were slowing down and therefore Scheduler could not kill the thread? Did exclamation mark in your regexp has any meaning? What was your intention?

Can you reproduce it? Regular expression (.*|.*)org is always complex, so you can test it with this. Thanks.
Comment 6 Milutin Kristofic 2015-03-16 13:53:44 UTC
I made a few performance changes in search from September 2014. One was for invalid regexp expressions and other was for complex regular expressions. I think they helped with the issue. If there is still problem, I need more recent snapshot and some reproducible steps. Thank you