microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
163.95k stars 29.18k forks source link

Huge Slowdown #62421

Closed hipstersmoothie closed 5 years ago

hipstersmoothie commented 6 years ago

In the past two days VSCode has become unusable. Currently it y freezes every 5 minutes and has to reopen itself.

jkells commented 6 years ago

Having the same issue, every 5 minutes or so the window freezes, sometimes it recovers after 30 seconds or so. This is a medium sized typescript project running webpack-dev-server in watch mode as a build task.

Version: VS Code version: Code - Insiders 1.29.0-insider (97ad72a02c351d6cde0fd32b41d9700a43e5964a, 2018-10-31T06:11:22.318Z) OS version: Darwin x64 17.7.0

Edited to add process sample: sample.txt

I wasn't able to open dev tools inside VSCode.

Extensions I've got installed:

Extension Author (truncated) Version
bracket-pair-colorizer Coe 1.0.60
vscode-eslint dba 1.7.0
gitlens eam 8.5.6
tslint eg2 1.0.40
tsfmt-vscode ete 0.2.1
awesometypescriptproblemmatcher Jua 0.3.0
code-beautifier mic 2.1.0
vsliveshare ms- 0.3.897
vsliveshare-audio ms- 0.1.39
vsliveshare-pack ms- 0.2.0
debugger-for-chrome msj 4.10.2
vscode-jest Ort 2.9.2
quicktype qui 12.0.46
velocity sod 0.1.0
code-spell-checker str 1.6.10
sort-lines Tyr 1.7.0
MatthiasWinkelmann commented 6 years ago

I am experiencing the same problem. Console.app shows the following errors, mot often associated with opening files. That is also when the 30-second plus freezes seem to be happening.

libnetwork.dylib 0 error 92506: 0x365b5c 00:19:16.743646 +0100 0x365b5c 92506 Code - Insiders Helper 0 nw_path_close_fd Failed to close guarded necp fd 35 [9: Bad file descriptor] Of note: the system does not react to input during these freezes, yet neither CPU, nor I/O rate or RAM seem be excessive. The "spinning beachball" type of event is associated with I/O issue IIRC.

Now it just disproved me with 200% CPU usage for a minute while being unresponsive. I managed to to take a sample of the process (see attached). I have approx zero experience this close to the OS, but the word "mutex" does seem to appear an awful lot?

Sample of Code - Insiders Helper.txt

I also found several of the following reports in the automatically generated diagnostics (Sorry for the long quotes instead of attachments–github does not like these files):

Date/Time:       2018-11-02 00:15:00 +0100
End time:        2018-11-02 00:15:03 +0100
OS Version:      Mac OS X 10.14 (Build 18A389)
Architecture:    x86_64h
Report Version:  27
Incident Identifier: 519D1AE9-8FD3-4065-B148-A5F170C1470F

Data Source:     Microstackshots
Shared Cache:    0x28ab7000 0F23CE82-2520-3AD4-84B2-691D6CA810F6

Command:         Code - Insiders Helper
Path:            /Applications/Visual Studio Code - Insiders.app/Contents/Frameworks/Code - Insiders Helper.app/Contents/MacOS/Code - Insiders Helper
Identifier:      com.microsoft.VSCodeInsiders.helper
Version:         ??? (???)
PID:             10715

Event:           wakeups
Action taken:    none
Wakeups:         45001 wakeups over the last 50 seconds (901 wakeups per second average), exceeding limit of 150 wakeups per second over 300 seconds
Wakeups limit:   45000
Limit duration:  300s
Wakeups caused:  45001
Duration:        3.78s
Steps:           2

Hardware model:  iMac14,2
Active cpus:     8
Boot args:       -v uia_exclude=HS08 dart=0 

Heaviest stack for the target process:
  1  thread_start + 13 (libsystem_pthread.dylib + 9253) [0x7fff7fcc8425]
  1  _pthread_start + 70 (libsystem_pthread.dylib + 25255) [0x7fff7fccc2a7]
  1  _pthread_body + 126 (libsystem_pthread.dylib + 13117) [0x7fff7fcc933d]
  1  ??? (Electron Framework + 53530055) [0x10ad61dc7]
  1  ??? (Electron Framework + 53724329) [0x10ad914a9]
  1  ??? (Electron Framework + 53834628) [0x10adac384]
  1  ??? (Electron Framework + 53720275) [0x10ad904d3]
  1  ??? (Electron Framework + 53835537) [0x10adac711]
  1  ??? (Electron Framework + 54120786) [0x10adf2152]
  1  ??? (libnode.dylib + 8268136) [0x10cce6968]
  1  ??? (libnode.dylib + 8267279) [0x10cce660f]
  1  pthread_mutex_lock + 99 (libsystem_pthread.dylib + 4494) [0x7fff7fcc718e]
Powerstats for:  Code - Insiders Helper [10715] [unique pid 309464]
UUID:            1F0A351E-68D6-330F-833E-5AEFB4D45087
Path:            /Applications/Visual Studio Code - Insiders.app/Contents/Frameworks/Code - Insiders Helper.app/Contents/MacOS/Code - Insiders Helper
Architecture:    x86_64
Parent:          UNKNOWN [10709]
Responsible:     UNKNOWN [1104]
UID:             501
Footprint:       325.19 MB
Start time:      2018-11-02 00:15:00 +0100
End time:        2018-11-02 00:15:03 +0100
Num samples:     2 (100%)
Primary state:   1 samples Non-Frontmost App, Non-Suppressed, User mode, Effective Thread QoS Default, Requested Thread QoS User Interactive, Override Thread QoS Unspecified
User Activity:   0 samples Idle, 2 samples Active
Power Source:    0 samples on Battery, 2 samples on AC
  1  thread_start + 13 (libsystem_pthread.dylib + 9253) [0x7fff7fcc8425]
    1  _pthread_start + 70 (libsystem_pthread.dylib + 25255) [0x7fff7fccc2a7]
      1  _pthread_body + 126 (libsystem_pthread.dylib + 13117) [0x7fff7fcc933d]
        1  ??? (Electron Framework + 53530055) [0x10ad61dc7]
          1  ??? (Electron Framework + 53724329) [0x10ad914a9]
            1  ??? (Electron Framework + 53834628) [0x10adac384]
              1  ??? (Electron Framework + 53720275) [0x10ad904d3]
                1  ??? (Electron Framework + 53835537) [0x10adac711]
                  1  ??? (Electron Framework + 54120786) [0x10adf2152]
                    1  ??? (libnode.dylib + 8268136) [0x10cce6968]
                      1  ??? (libnode.dylib + 8267279) [0x10cce660f]
                        1  pthread_mutex_lock + 99 (libsystem_pthread.dylib + 4494) [0x7fff7fcc718e]
                          1  <Effective Thread QoS Unspecified, Requested Thread QoS Unspecified>
  1  start + 1 (libdyld.dylib + 94341) [0x7fff7fad7085]
    1  main + 38 (Code - Insiders Helper + 3878) [0x107a45f26]
      1  AtomMain + 68 (Electron Framework + 10692) [0x107a579c4]
        1  ??? (Electron Framework + 21857844) [0x108f2d634]
          1  ??? (Electron Framework + 62704532) [0x10b621b94]
            1  ??? (Electron Framework + 21860432) [0x108f2e050]
              1  ??? (Electron Framework + 21120081) [0x108e79451]
                1  ??? (Electron Framework + 53438531) [0x10ad4b843]
                  1  ??? (Electron Framework + 53820012) [0x10ada8a6c]
                    1  ??? (Electron Framework + 53825214) [0x10ada9ebe]
                      1  -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 280 (Foundation + 116186) [0x7fff54d9e5da]
                        1  CFRunLoopRunSpecific + 463 (CoreFoundation + 240868) [0x7fff52a3dce4]
                          1  __CFRunLoopRun + 1219 (CoreFoundation + 242682) [0x7fff52a3e3fa]
                            1  __CFRunLoopDoSources0 + 195 (CoreFoundation + 245329) [0x7fff52a3ee51]
                              1  __CFRunLoopDoSource0 + 108 (CoreFoundation + 361387) [0x7fff52a5b3ab]
                                1  __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17 (CoreFoundation + 361477) [0x7fff52a5b405]
                                  1  ??? (Electron Framework + 53821791) [0x10ada915f]
                                    1  ??? (Electron Framework + 53745434) [0x10ad9671a]
                                      1  ??? (Electron Framework + 53823546) [0x10ada983a]
                                        1  ??? (Electron Framework + 53521641) [0x10ad5fce9]
                                          1  ??? (Electron Framework + 53520917) [0x10ad5fa15]
                                            1  ??? (Electron Framework + 53519915) [0x10ad5f62b]
                                              1  ??? (Electron Framework + 54120786) [0x10adf2152]
                                                1  ??? (Electron Framework + 54766546) [0x10ae8fbd2]
                                                  1  ??? (Electron Framework + 54774616) [0x10ae91b58]
                                                    1  ??? (Electron Framework + 54120786) [0x10adf2152]
                                                      1  ??? (Electron Framework + 30657355) [0x109791b4b]
                                                        1  ??? (Electron Framework + 21529862) [0x108edd506]
                                                          1  atom::AtomRenderFrameObserver::OnMessageReceived(IPC::Message const&) + 146 (Electron Framework + 1348658) [0x107b9e432]
                                                            1  ??? (Electron Framework + 1348908) [0x107b9e52c]
                                                              1  ??? (Electron Framework + 1351064) [0x107b9ed98]
                                                                1  ??? (Electron Framework + 1351081) [0x107b9eda9]
                                                                  1  ??? (Electron Framework + 1351129) [0x107b9edd9]
                                                                    1  atom::AtomRenderFrameObserver::OnBrowserMessage(bool, std::__1::basic_string<unsigned short, base::string16_char_traits, std::__1::allocator<unsigned short> > const&, base::ListValue const&) + 97 (Electron Framework + 1349153) [0x107b9e621]
                                                                      1  atom::AtomRenderFrameObserver::EmitIPCEvent(blink::WebLocalFrame*, std::__1::basic_string<unsigned short, base::string16_char_traits, std::__1::allocator<unsigned short> > const&, base::ListValue const&) + 309 (Electron Framework + 1349557) [0x107b9e7b5]
                                                                        1  ??? (Electron Framework + 1350221) [0x107b9ea4d]
                                                                          1  mate::internal::CallMethodWithArgs(v8::Isolate*, v8::Local<v8::Object>, char const*, std::__1::vector<v8::Local<v8::Value>, std::__1::allocator<v8::Local<v8::Value> > >*) + 79 (Electron Framework + 1165983) [0x107b71a9f]
                                                                            1  node::MakeCallback(v8::Isolate*, v8::Local<v8::Object>, char const*, int, v8::Local<v8::Value>*, node::async_context) + 95 (libnode.dylib + 932431) [0x10c5e7a4f]
                                                                              1  node::MakeCallback(v8::Isolate*, v8::Local<v8::Object>, v8::Local<v8::String>, int, v8::Local<v8::Value>*, node::async_context) + 92 (libnode.dylib + 932556) [0x10c5e7acc]
                                                                                1  node::MakeCallback(v8::Isolate*, v8::Local<v8::Object>, v8::Local<v8::Function>, int, v8::Local<v8::Value>*, node::async_context) + 109 (libnode.dylib + 932685) [0x10c5e7b4d]
                                                                                  1  node::InternalMakeCallback(node::Environment*, v8::Local<v8::Object>, v8::Local<v8::Function>, int, v8::Local<v8::Value>*, node::async_context) + 118 (libnode.dylib + 932214) [0x10c5e7976]
                                                                                    1  v8::Function::Call(v8::Local<v8::Context>, v8::Local<v8::Value>, int, v8::Local<v8::Value>*) + 492 (libnode.dylib + 5660508) [0x10ca69f5c]
                                                                                      1  v8::internal::Execution::Call(v8::internal::Isolate*, v8::internal::Handle<v8::internal::Object>, v8::internal::Handle<v8::internal::Object>, int, v8::internal::Handle<v8::internal::Object>*) + 140 (libnode.dylib + 3704876) [0x10c88c82c]
                                                                                        1  ??? (libnode.dylib + 3705591) [0x10c88caf7]
                                                                                          1  ??? [0x34f1bd18410d]
                                                                                            1  ??? [0x34f1bd23e499]
                                                                                              1  ??? [0x34f1bd185d1b]
                                                                                                1  ??? [0x34f1bd89881f]
                                                                                                  1  ??? [0x34f1bd23f9ee]
                                                                                                    1  ??? [0x34f1bd274068]
                                                                                                      1  ??? [0x34f1bd185d1b]
                                                                                                        1  ??? [0x34f1bd23f9ee]
                                                                                                          1  ??? [0x34f1bd27461c]
                                                                                                            1  ??? [0x34f1bd44c1e4]
                                                                                                              1  ??? [0x34f1bd23f9ee]
                                                                                                                1  ??? [0x34f1bd27461c]
                                                                                                                  1  ??? [0x34f1bd44c1e4]
                                                                                                                    1  ??? [0x34f1bd23f9ee]
                                                                                                                      1  ??? [0x34f1bd27461c]
                                                                                                                        1  ??? [0x34f1bd23f9ee]
                                                                                                                          1  ??? [0x34f1bd27461c]
                                                                                                                            1  ??? [0x34f1bd23f9ee]
                                                                                                                              1  ??? [0x34f1bd274ef2]
                                                                                                                                1  ??? [0x34f1bd23f9ee]
                                                                                                                                  1  ??? [0x34f1bd27461c]
                                                                                                                                    1  ??? [0x34f1bd44c4c7]
                                                                                                                                      1  ??? [0x34f1bd18441d]
                                                                                                                                        1  ??? (libnode.dylib + 7223025) [0x10cbe76f1]
                                                                                                                                          1  ??? (libnode.dylib + 3027218) [0x10c7e7112]
                                                                                                                                            1  ??? (libnode.dylib + 3025987) [0x10c7e6c43]
                                                                                                                                              1  ??? (libnode.dylib + 7039122) [0x10cbba892]
                                                                                                                                                1  _platform_memmove$VARIANT$Haswell + 41 (libsystem_platform.dylib + 7433) [0x7fff7fcbdd09]

  Binary Images:
           0x107a45000 -        0x107a45fff  com.microsoft.VSCodeInsiders.helper (0) <1F0A351E-68D6-330F-833E-5AEFB4D45087>  /Applications/Visual Studio Code - Insiders.app/Contents/Frameworks/Code - Insiders Helper.app/Contents/MacOS/Code - Insiders Helper
           0x107a55000 -        0x10bd2cfff  com.github.electron.framework (0)       <59C2E3C7-4474-33AE-ABE9-493325EBE98F>  /Applications/Visual Studio Code - Insiders.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework
           0x10c504000 -        0x10d389fff  libnode.dylib (0)                       <AC9AD6E8-202D-3A6F-85E5-CCCC64C4CCE7>  /Applications/Visual Studio Code - Insiders.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib
        0x7fff52a03000 -     0x7fff52e52fff  com.apple.CoreFoundation 6.9 (1555.10)  <4A4C87BC-4C8E-392A-ABEE-824D4074C485>  /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
        0x7fff54d82000 -     0x7fff55150fff  com.apple.Foundation 6.9 (1555.10)      <0CCAF9AF-F7AF-3174-98D4-6C188B1079CC>  /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation
        0x7fff7fac0000 -     0x7fff7faeffff  libdyld.dylib (625.13)                  <4B16C209-83D4-3817-9B62-C2F7FFB23755>  /usr/lib/system/libdyld.dylib
        0x7fff7fcbc000 -     0x7fff7fcc5fff  libsystem_platform.dylib (177.200.16)   <B75B04AD-69FE-3ADE-84D2-C17972FC8F49>  /usr/lib/system/libsystem_platform.dylib
        0x7fff7fcc6000 -     0x7fff7fcd0fff  libsystem_pthread.dylib (330.201.1)     <87A6B136-E423-3B6D-A58A-137F392D7D9D>  /usr/lib/system/libsystem_pthread.dylib

Finally, here are status and extensions:

Version:          Code - Insiders 1.29.0-insider (d7ac6e838f51a03f7d417b4758f5fb075878d615, 2018-11-01T06:11:43.390Z)
OS Version:       Darwin x64 18.0.0
CPUs:             Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz (8 x 4009)
Memory (System):  32.00GB (3.14GB free)
Load (avg):       11, 9, 7
VM:               0%
Screen Reader:    no
Process Argv:     /Users/../application.rb
GPU Status:       2d_canvas:                    enabled
                  checker_imaging:              disabled_off
                  flash_3d:                     enabled
                  flash_stage3d:                enabled
                  flash_stage3d_baseline:       enabled
                  gpu_compositing:              enabled
                  multiple_raster_threads:      enabled_on
                  native_gpu_memory_buffers:    enabled
                  rasterization:                unavailable_software
                  video_decode:                 enabled
                  video_encode:                 enabled
                  webgl:                        enabled
                  webgl2:                       enabled

CPU %   Mem MB     PID  Process
    3      131   10709  code-insiders main
    2       66   10714     gpu-process
    0       98   10829     shared-process
    5      262   95488     window (Extension: Vetur — rails)
    0       66   95492       extensionHost
    0       33   95494       watcherService
    0       33   95499       searchService
    0       66   99282     window (undefined)

Workspace Stats: | Window (Extension: Vetur — rails) | Folder (rails): 4977 files | File types: cache(314) rb(102) rake(26) erb(22) elmo(14) elm(13) yml(9) | html(9) js(8) elmi(6) | Conf files: package.json(1) launch.json(1) settings.json(1) | Launch Configs: Ruby(4)

Astrantia commented 6 years ago

Experiencing the same problem

kieferrm commented 6 years ago

@hipstersmoothie @jkells @MatthiasWinkelmann @Astrantia does that also happen when launch --disable-extensions.

hipstersmoothie commented 6 years ago

I am on a typescript project as well

Chandu3245 commented 6 years ago

Its very much annoying, freezes for every 5 minutes.

chrmarti commented 6 years ago

Everyone: Please try running with extensions disabled (--disable-extensions) and acquire a performance profile (https://github.com/Microsoft/vscode/wiki/Performance-Issues) during the slowdown/freeze.

jrieken commented 6 years ago

Can anyone create a CPU profile of the renderer? The process is explained here: https://github.com/Microsoft/vscode/wiki/Performance-Issues#the-rendererwindow-process-consumes-a-lot-of-cpu

jkells commented 5 years ago

@jrieken I tried, left the dev tools open while I've been working so I could run it when it freezes. Unfortunately it just hangs Profiling... can't click stop. Haven't tried without extensions yet.

jkells commented 5 years ago

CPU-20181106T110946.cpuprofile.zip

CPU profile attached, extensions weren't disabled but it still might help you. It took about 60 seconds to open developer tools, I was able to do it from the help menu not the F1 menu. I hit stop on the profiler after about 5 seconds but it took about 5 minutes to actually stop.

jkells commented 5 years ago

This could be anecdotal but I feel like it's happening much more regularly when I have webpack-dev-server running as a build task. It didn't happen yesterday morning while I didn't have the dev server running.

jrieken commented 5 years ago

Thanks @jkells! This is really helpful. It seems like an insane amount of IPC messages are being received by the renderer. Those messages are most likely coming from file event, search, or debugging (telemetry). I don't think that the latter two cause this, but my suspect is file watching, esp since you have mentioned the webpack-dev-server.

screenshot 2018-11-06 at 09 12 04

@jkells Can you use the files.watcherExclude property and exclude suspicious webpack folders? Like temp folders which contain compilation artefacts and things like that

jrieken commented 5 years ago

@hipstersmoothie @jkells @MatthiasWinkelmann @Astrantia are you guys using webpack-dev-server too? Or some other build tool that creates/writes/deletes many, many files?

Astrantia commented 5 years ago

@jrieken I'm using Latex. The extension is provided by https://github.com/James-Yu/LaTeX-Workshop

I know it's watching over files and sometimes writing and deleting ones, but it's not on bar with webpack.

I'll try to get a hand on profiler too.

hipstersmoothie commented 5 years ago

I was using storybook so yes On Tue, Nov 6, 2018 at 12:21 AM Astrantia notifications@github.com wrote:

@jrieken https://github.com/jrieken I'm using Latex. The extension is provided by https://github.com/James-Yu/LaTeX-Workshop

I know it's watching over files and sometimes writing and deleting ones, but it's not on bar with webpack.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Microsoft/vscode/issues/62421#issuecomment-436167906, or mute the thread https://github.com/notifications/unsubscribe-auth/ABIyBO9gNXDeDEBtnpY7a8XZNPYT5fxcks5usUabgaJpZM4YJs0f .

jrieken commented 5 years ago

@hipstersmoothie this is using a mac, right? (just like @jkells and @MatthiasWinkelmann). @Astrantia what OS are you using?

hipstersmoothie commented 5 years ago

Yup I’m on a Mac

On Tue, Nov 6, 2018 at 12:38 AM Johannes Rieken notifications@github.com wrote:

@hipstersmoothie https://github.com/hipstersmoothie this is using a mac, right? (just like @jkells https://github.com/jkells and @MatthiasWinkelmann https://github.com/MatthiasWinkelmann). @Astrantia https://github.com/Astrantia what OS are you using?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Microsoft/vscode/issues/62421#issuecomment-436172060, or mute the thread https://github.com/notifications/unsubscribe-auth/ABIyBE-fqqCNwoTyALrrscrMFssxWHLEks5usUp9gaJpZM4YJs0f .

jrieken commented 5 years ago

Anyone using a multi root workspace (foo.code-workspace-file) or is this just with having a folder opened?

Astrantia commented 5 years ago

@jrieken I'm on Windows and no multi root workspaces. I wanted to take a look in --verbose, but I can't trace the logs in verbose because of the following error message:

~ code-insiders --verbose

[17240:1106/035407.853:ERROR:network_change_notifier_win.cc(157)] WSALookupServiceBegin failed with: 8
[main 3:54:07 AM] Sending env to running instance...
[main 3:54:07 AM] Sending some foreground love to the running instance: 17536
[main 3:54:08 AM] Sent env to running instance. Terminating...
[main 3:54:08 AM] Lifecycle#kill()
[17240:1106/035408.027:ERROR:browser_gpu_channel_host_factory.cc(103)] Failed to launch GPU process.
jrieken commented 5 years ago

@jkells Any chance that you can share that project with us?

hipstersmoothie commented 5 years ago

Not in a workspace, just a folder. Running my dev server in iterm and still getting the slowdown

jkells commented 5 years ago

Can't share the project sorry, I've been running without extensions for a few hours without any crashes

MatthiasWinkelmann commented 5 years ago

The problem disappeared for me at around the time I disabled extensions, and has not reappeared even after enabling extensions again. This may be due to working on different projects (with different setups for webpack-dev-server and similar), but I suspect some intermediate update may have fixed it.

jkells commented 5 years ago

No crashes for me yesterday, going to re-enable extensions and see what happens

hipstersmoothie commented 5 years ago

Still present for me. Had to force quit around half a dozen times today On Wed, Nov 7, 2018 at 3:32 PM Jared Kells notifications@github.com wrote:

No crashes for me yesterday, going to re-enable extensions and see what happens

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Microsoft/vscode/issues/62421#issuecomment-436816480, or mute the thread https://github.com/notifications/unsubscribe-auth/ABIyBNVVrBQaAobQAgumohnQRwDGoOzKks5us219gaJpZM4YJs0f .

jrieken commented 5 years ago

@jkells seems like we are getting closer to this. did I get that right? this went away with disabling (some?) extensions? Unrelated to webpack-dev-server?

jrieken commented 5 years ago

/duplicate of https://github.com/Microsoft/vscode/issues/62970

vscodebot[bot] commented 5 years ago

Thanks for creating this issue! We figured it's covering the same as another one we already have. Thus, we closed this one as a duplicate. You can search for existing issues here. See also our issue reporting guidelines.

Happy Coding!

jrieken commented 5 years ago

closing this as dupe as the other (later) issue has more information