Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

editor, run away cpu utilization #11463

Closed
DartBot opened this issue Jun 23, 2013 · 4 comments
Closed

editor, run away cpu utilization #11463

DartBot opened this issue Jun 23, 2013 · 4 comments
Assignees
Labels
P1 A high priority bug; for example, a single project is unusable or has many test failures
Milestone

Comments

@DartBot
Copy link

DartBot commented Jun 23, 2013

This issue was originally filed by @jptrainor


The latest editor is getting itself into a state where it is consuming huge cpu resources.

A grab of the OSX process monitor showing 200+ % is attached. This wasn't transient it was sitting in this state indefinitely. It is fine when it starts. I haven't figured out what happens exactly to put it in this state.

A jstack stack trace is attached, caught when it was in this state.

Dart Editor version 0.5.20_r24275
Dart SDK version 0.5.20.4_r24275
OSX 10.8.4
java version "1.6.0_45"
Java(TM) SE Runtime Environment (build 1.6.0_45-b06-451-11M4406)
Java HotSpot(TM) 64-Bit Server VM (build 20.45-b01-451, mixed mode)

Additional notes:

It literally roasts my iMac - the enclosure temp goes up to 90 C according to my Tunabelly Temperatue Gauge app! It also and drained the battery on my MacBook in an hour and caused its fan to come on full speed before I realized what was going on.


Attachments:
DartEditorCpuConsumption.jpg (31.40 KB)
jstack.out (41.83 KB)

@bwilkerson
Copy link
Member

Added this to the M6 milestone.
Removed Priority-Unassigned label.
Added Priority-High, Area-Editor, Triaged labels.

@scheglov
Copy link
Contributor

With this threads stack dump I'm almost sure that there is something to fix in folding.


cc @danrubel.
Set owner to @stevemessick.

@DartBot
Copy link
Author

DartBot commented Jun 24, 2013

This comment was originally written by @jptrainor


The example I gave you showed two of these "folding" threads stuck. It will also happen to just a single thread. I caught it busy in a single thread and grabbed the attached four stack traces to see what changed over time. Very little changes, in fact. Most of the threads are stopped waiting. The apparent busy thread ("query_norm.dart") is in the same place each time.

The "folding" thread in this case was busy with "query_norm.dart". The file was not open in my editor nor had I worked with it during that editing session, although I had worked with a file that contained a class that used it. After noticing this I went ahead and opened it and found everything worked fine, including the folding operations. Although I didn't actually edit it.

Each of the attached stacks are 5-10 seconds apart.

Here is where it appears stuck:
com.google.dart.tools.ui.text.folding.DartFoldingStructureProvider$TokenStream.begin(DartFoldingStructureProvider.java:576):

   // DartFoldingStructureProvider.java at code at my last read-only snapshot
   void begin(int start) {
      if (start == begin) {
        return;
      }
      if (start < begin) {
        begin = 0;
        currentToken = firstToken;
      }
      while (begin < start) { <<<<<<< HERE is line 576, this is the stuck loop it seems
        currentToken = currentToken.getNext();
        begin = currentToken.getOffset();
      }
    }

... so something in your token reader, or an odd start value?


Attachments:
jstack.out.1 (21.07 KB)
jstack.out.2 (21.59 KB)
jstack.out.3 (21.59 KB)
jstack.out.4 (22.58 KB)

@stevemessick
Copy link
Contributor

Possibly fixed with
https://chromiumcodereview.appspot.com/17567005/

Thanks for the excellent feedback. Just wish I could reproduce the problem.


Added Fixed label.

@DartBot DartBot added Type-Defect P1 A high priority bug; for example, a single project is unusable or has many test failures labels Jun 24, 2013
@DartBot DartBot added this to the M6 milestone Jun 24, 2013
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P1 A high priority bug; for example, a single project is unusable or has many test failures
Projects
None yet
Development

No branches or pull requests

4 participants