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

Leaking notifications make VS Code freeze #62970

Closed
gregvanl opened this issue Nov 12, 2018 · 67 comments
Closed

Leaking notifications make VS Code freeze #62970

gregvanl opened this issue Nov 12, 2018 · 67 comments
Assignees
Labels
candidate Issue identified as probable candidate for fixing in the next release freeze-slow-crash-leak VS Code crashing, performance, freeze and memory leak issues important Issue identified as high-priority macos Issues with VS Code on MAC/OS X verified Verification succeeded windows VS Code on Windows issues

Comments

@gregvanl
Copy link

gregvanl commented Nov 12, 2018

  • VSCode Version: 1.29.0 Insiders
  • OS Version: Windows

Several hangs in a row. Attached are the log files from two of the hangs which contain the error [error] [VS Code]: detected unresponsive.

InsidersHangs.zip

@cleidigh cleidigh added the freeze-slow-crash-leak VS Code crashing, performance, freeze and memory leak issues label Nov 12, 2018
@roblourens
Copy link
Member

What were you doing before the hangs?

I don't think the logs have any useful info besides this error which shows up many times after the hang message in one instance

[error] SyntaxError: Unexpected token o in JSON at position 0
    at JSON.parse (<anonymous>)
    at c (C:\Users\gregvanl\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\out\vs\code\electron-main\main.js:177:254)
    at e.onBuffer (C:\Users\gregvanl\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\out\vs\code\electron-main\main.js:182:571)
    at C:\Users\gregvanl\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\out\vs\code\electron-main\main.js:180:669
    at e.fire (C:\Users\gregvanl\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\out\vs\code\electron-main\main.js:122:218)
    at C:\Users\gregvanl\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\out\vs\code\electron-main\main.js:185:795
    at C:\Users\gregvanl\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\out\vs\code\electron-main\main.js:120:478
    at C:\Users\gregvanl\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\out\vs\code\electron-main\main.js:120:705
    at e.fire (C:\Users\gregvanl\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\out\vs\code\electron-main\main.js:122:218)
    at EventEmitter.r (C:\Users\gregvanl\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\out\vs\code\electron-main\main.js:127:987)
    at emitTwo (events.js:131:20)
    at EventEmitter.emit (events.js:214:7)
    at WebContents.<anonymous> (C:\Users\gregvanl\AppData\Local\Programs\Microsoft VS Code Insiders\resources\electron.asar\browser\api\web-contents.js:286:13)
    at emitTwo (events.js:126:13)
    at WebContents.emit (events.js:214:7)

@jrieken is there any way to tie this to issues we've looked at lately?

@roblourens roblourens added the info-needed Issue requires more information from poster label Nov 13, 2018
@jrieken jrieken added the 1-29-x label Nov 13, 2018
@jrieken
Copy link
Member

jrieken commented Nov 13, 2018

Yeah, could be the memory/listener leak... Best is to try with latest insiders or 1.29 stable...

@jrieken
Copy link
Member

jrieken commented Nov 13, 2018

Otherwise, jump straight to cpu profiling the renderer processes via: F1 > Toggle Developer Tools. In the overflow menu select 'More Tools > JavaScript Profiler'. In there select start, let it profile for 30 to 60 seconds, stop it, save it to a file and attach the file here. Thanks.

screen shot 2017-09-28 at 09 44 31

@sgyzetrov
Copy link

Hi, I am also experiencing hang. VS Code version Version 1.29.0, macOS 10.13.6 (17G3025)

But unfortunately, because the window was unresponsive, I cannot get developer tool to launch, so I did not get any CPU profiling. But I do have control over other VS Code windows running separately to the window that frozen. Will profiling other windows produce useful information? Also, during the hang, Code Helper spiked to 100%.

@joseph1125
Copy link

1.29 stable with Windows 10 also experience this problem

@tomaxsas
Copy link

same here with Win 10 and 1.29.0

@jrieken
Copy link
Member

jrieken commented Nov 13, 2018

@sgyzetrov @joseph1125 @tomaxsas Only CPU profiling will help us understand this. If the hang is very bad, then restart VS Code, start dev tools and keep them in the background, and profile when the editor is unresponsive.

@sgyzetrov
Copy link

@sgyzetrov @joseph1125 @tomaxsas Only CPU profiling will help us understand this. If the hang is very bad, then restart VS Code, start dev tools and keep them in the background, and profile when the editor is unresponsive.

Yeah...I did that, just now. After letting dev tool run in the background for more than 3 hrs, finally VS Code hang again (I was not even working on it, I was browsing Reddit on another macOS desktop), and this time, CPU profiler got stuck too.

I clicked start (it then turned into a red 'stop'), I then let it run for 57 sec, nothing happened, so I clicked 'stop'. BUT then it just STUCK. There is no info coming up, I tried to start a new profile, but the button is a grey 'start'. And collect garage, clear all profiles were all unresponsive. start CPU profiling told me another profiling is already running, but I definitely clicked stop.

activity_monitor__all_processes_-2

activity_monitor__all_processes_

Looks to me there is a serious memory leak. I will wait for another hang and keep trying to acquire the CPU profile you want, stand by.

@sgyzetrov
Copy link

Had to force quit Code Helper and VS Code to let my fan slow down...

@jrieken
Copy link
Member

jrieken commented Nov 13, 2018

I then let it run for 57 sec,

Try to profile for much shorter then, 5-10 seconds and even then it can take a very long time to finally save the profile.

@vishwa-raj
Copy link

I have also experienced this twice just now.
VS Code freezing when it's not even being worked on.
1.29 on Windows 10

@tecosaur
Copy link

I'm getting this severely too. Is there any way I can roll back to the previous version?

@jrieken jrieken added macos Issues with VS Code on MAC/OS X windows VS Code on Windows issues labels Nov 13, 2018
@jrieken
Copy link
Member

jrieken commented Nov 13, 2018

@VishwaRajGit @tecosaur please help us profile this.

  • start dev tools via F1 > Developer Tools
  • open the cpu profiler via 'More Tools > CPU Profiler' in the overflow menu (see Leaking notifications make VS Code freeze #62970 (comment))
  • pop-out and minimise the dev tools window
  • use vs code as usual and wait for it to slow down
  • when it hangs, freezes, or slows down, then go to dev tools and hit 'Start' in the CPU Profiler tab
  • profile for 5-10 seconds and press the red botton to stop profiling
  • be patient and when the profile appears, select 'Save', and share the profile here

nov-13-2018 18-08-19

Thanks for your help.

@jrieken
Copy link
Member

jrieken commented Nov 13, 2018

everyone also attach the list of extensions you are using, simply run code --list-extensions.

@dgolovin
Copy link

dgolovin commented Nov 13, 2018

@jrieken After vs code window was frozen, I was following the steps above and profiler just got into state shown below. I am still waiting for 'Save' to appear, but it seems never going to happen.
image

I am on Windows 10 Pro

code --version
1.29.0
5f24c93878bd4bc645a4a17c620e2487b11005f9
x64

@gitawego
Copy link

gitawego commented Nov 13, 2018

my vscode got hangs as well with new version in windows 10

my extensions:
dbaeumer.vscode-eslint
donjayamanne.githistory
eamodio.gitlens
EditorConfig.EditorConfig
eg2.tslint
esbenp.prettier-vscode
formulahendry.auto-close-tag
formulahendry.auto-rename-tag
mikegleasonjr.theme-go
ms-python.python
ms-vscode.Go
msjsdiag.debugger-for-chrome
PeterJausovec.vscode-docker
redhat.java
robertohuertasm.vscode-icons
rust-lang.rust
streetsidesoftware.code-spell-checker

@florentcm
Copy link

Same here. Happens every 10-15 minutes.
version 1.29 on Windows 10.
Experienced the freeze more than a dozen of times today since updating to last version.

@khayuenkam
Copy link

khayuenkam commented Nov 13, 2018

Freeze quite frequently to me as well.
I have attached the cpu profile which is in .txt extension since Github not allow to upload .cpuprofile

profile.txt

VSCode Version: 1.29.0
OS Version: MacOS 10.13.6

Code Extensions:

  • CoenraadS.bracket-pair-colorizer
  • eamodio.gitlens
  • jcanero.hoogle-vscode
  • justusadam.language-haskell
  • sdras.night-owl
  • Vans.haskero
  • vscodevim.vim

@sgyzetrov
Copy link

Hi folks,

It sees VS Code will reproduce this hang whenever it is not being worked on. Although strangely if your workspace only contains markdown or HTML this issue would not occur. Since I did not experience hang in separate VS Code windows where I was editing .md or .html files.

The window I got hang was the one I was editing .tex files with latex-workshop plugin.

@jrieken Johannes, I finally got the CPU profile. This time I profiled for 5 sec, after waiting for about 5 min I was able saved it.

My extensions are listed below.

Gimly81.matlab
austin.code-gnu-global
DavidAnson.vscode-markdownlint
DotJoshJohnson.xml
gnhuy91.theme-oceanicnext-sublime
James-Yu.latex-workshop
magicstack.MagicPython
mitaki28.vscode-clang
ms-python.python
ms-vscode.azure-account
ms-vscode.cpptools
naumovs.theme-oceanicnext
PeterJausovec.vscode-docker
PKief.material-icon-theme
redhat.java
tht13.python
vscjava.vscode-java-debug
vscjava.vscode-java-pack
vscjava.vscode-java-test
vscjava.vscode-maven
yzhang.markdown-all-in-one

CPU profile with .txt extension added
CPU-20181114T084129.cpuprofile.txt

@alex-ketch
Copy link

Similar to @sgyzetrov I've noticed VS Code reliably freezing if I switch focus to a different application and then come back to it.

Attached is a CPU profile from the latest freeze. I only tabbed over to Safari for a few seconds.
Please let me know if I can help any further.

VSCode Version: 1.30.0-insider
OS Version: MacOS 10.14.1

Installed Extensions
  • Zarel.sublime-commands
  • Zignd.html-css-class-completion
  • aaron-bond.better-comments
  • abusaidm.html-snippets
  • alanz.vscode-hie-server
  • alefragnani.Bookmarks
  • alefragnani.project-manager
  • alqiu.ts-loader-problem-matcher
  • andys8.jest-snippets
  • arcticicestudio.nord-visual-studio-code
  • bierner.markdown-preview-github-styles
  • christian-kohler.npm-intellisense
  • christian-kohler.path-intellisense
  • chrmarti.regex
  • daltonjorge.scala
  • dbaeumer.vscode-eslint
  • deerawan.vscode-dash
  • dinhani.divider
  • donjayamanne.githistory
  • eamodio.find-related
  • eamodio.gitlens
  • EditorConfig.EditorConfig
  • eg2.tslint
  • esbenp.prettier-vscode
  • felipe.nasc-touchbar
  • formulahendry.auto-rename-tag
  • gamunu.vscode-yarn
  • GitHub.vscode-pull-request-github
  • HookyQR.beautify
  • infeng.vscode-react-typescript
  • jcanero.hoogle-vscode
  • joelday.docthis
  • jpoissonnier.vscode-styled-components
  • jtlowe.vscode-icon-theme
  • justusadam.language-haskell
  • kevinkyang.auto-comment-blocks
  • kumar-harsh.graphql-for-vscode
  • maptz.camelcasenavigation
  • mgmcdermott.vscode-language-babel
  • mrmlnc.vscode-stylefmt
  • ms-vsliveshare.vsliveshare
  • msjsdiag.debugger-for-chrome
  • naumovs.color-highlight
  • nmsmith89.incrementor
  • nwolverson.ide-purescript
  • nwolverson.language-purescript
  • Orta.vscode-jest
  • PeterJausovec.vscode-docker
  • quicktype.quicktype
  • ryanluker.vscode-coverage-gutters
  • Shan.code-settings-sync
  • shaunlebron.vscode-parinfer
  • shinnn.stylelint
  • silvenon.mdx
  • sleistner.vscode-fileutils
  • stringham.move-ts
  • stubailo.ignore-gitignore
  • teabyii.ayu
  • vscodevim.vim
  • WallabyJs.quokka-vscode
  • wix.vscode-import-cost
  • wmaurer.change-case
  • xabikos.JavaScriptSnippets
  • xabikos.ReactSnippets
  • Yummygum.city-lights-icon-vsc
  • yzhang.markdown-all-in-one
  • zhuangtongfa.Material-theme

CPU profile with .txt extension added
CPU-20181113T205652.cpuprofile.txt

@fusengine
Copy link

why hide my comment 😹

@guillaumevincent
Copy link

guillaumevincent commented Nov 15, 2018

Freeze on fedora 29 also
Vscode:

1.29.0
5f24c93878bd4bc645a4a17c620e2487b11005f9
x64

My extensions:

esbenp.prettier-vscode
ms-python.python
robertohuertasm.vscode-icons

I'm going to test insider version

@mateuszgazdziak
Copy link

How to revert to previous version?

@fusengine
Copy link

How to revert to previous version?

@mateuszgazdziak do you have a lot process rg?

@lorenz068
Copy link

Same here on Mac OSX Mojave, since the 1.29.0 update

@JCMais
Copy link

JCMais commented Nov 15, 2018

Was having same issue, latest insiders seems to have fixed it, thanks for working on that.

@jrieken jrieken mentioned this issue Nov 15, 2018
@bsendras
Copy link

VSCode v1.29.0. hangs on Mac OSX High Sierra 10.13.6.

@jrieken
Copy link
Member

jrieken commented Nov 15, 2018

@bsendras Yeah, we already know that. We work full steam towards 1.29.1. In the meantime you can use insiders: http://code.visualstudio.com/insiders/ which already has the fix for this.

@mateuszgazdziak
Copy link

mateuszgazdziak commented Nov 15, 2018

@fusengine I work on Windows 10 :(

@YevhenKysilov
Copy link

YevhenKysilov commented Nov 15, 2018

#63214 I have problem with hangs too

@YusifKhalilov
Copy link

Same problem. This problem was in the insider version too. Why they released the stable version with this issue?

@jrieken
Copy link
Member

jrieken commented Nov 15, 2018

This problem was in the insider version too. Why they released the stable version with this issue?

That likely means that you don't have this issue but another issue. That's unhappy but we are here to help and fix. Please file a new issue, bonus points for providing version string, os, etc. Last, please following our perf guide: https://github.com/Microsoft/vscode/wiki/Performance-Issues

@fusengine
Copy link

When you fix that ?

@mjbvz mjbvz added verified Verification succeeded and removed verified Verification succeeded labels Nov 16, 2018
@roblourens roblourens added the verified Verification succeeded label Nov 16, 2018
@wannemuellerit
Copy link

Still having the same issues after your very recent fix. Especially problematic when scrolling or getting new input in the integrated terminal. Also, switching from 'files' to 'search' causes a good lag(and about 25% cpu usage for a few secs)

@jrieken
Copy link
Member

jrieken commented Nov 16, 2018

@oppoi1 This is about a memory leak that happens with uncleared notification. Your comment doesn't match that, so please file a new issue. Bonus points for following our guidelines: https://github.com/Microsoft/vscode/wiki/Performance-Issues

@jrieken jrieken changed the title VS Code hang Leaking notifications make VS Code freeze Nov 16, 2018
@potomek
Copy link

potomek commented Nov 16, 2018

Today this was happend when I pasted into JavaScript doc. sentence with spaces. I suppose the code validation system froze.

@jrieken
Copy link
Member

jrieken commented Nov 16, 2018

This issue is about a very specific, fast growing, memory leak that happens when having notifications. We have released a fix for this issue in 1.29.1 and 1.30-insiders. Please make sure to be one of those or later versions.

Different issues often show the same symptoms but the reverse if often not true. That means if you see a slowdown (symptom) it's very likely not this issue but another issue. Please try latest, please file new issues when an issue is closed, please follow this guide: https://github.com/Microsoft/vscode/wiki/Performance-Issues

@microsoft microsoft locked as resolved and limited conversation to collaborators Nov 16, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
candidate Issue identified as probable candidate for fixing in the next release freeze-slow-crash-leak VS Code crashing, performance, freeze and memory leak issues important Issue identified as high-priority macos Issues with VS Code on MAC/OS X verified Verification succeeded windows VS Code on Windows issues
Projects
None yet
Development

No branches or pull requests