-
Notifications
You must be signed in to change notification settings - Fork 12.8k
TSServer High CPU usage #31248
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
Comments
Does this reproduce in the latest VS Code insiders build with all extensions disabled? |
@mjbvz Yes :/ |
Also i have the same problem with Ubuntu (Unity, XFCE), Mate and Fedora. |
@mjbvz Any update on this bug? Also tested on Manjaro, i have same problem. It does not look it happens on Windows, it has little more CPU use, but not that much as in Linux. |
Same here. Ubuntu 18.04. Identical symptoms. Disabling JS & TS features built-in also fixes it. |
Have the same issue on MacOS Mojave. Using this as a workaround -
|
@kasik96 Please try collecting the TS Server log:
If you can share the log, I can also take a look to see if anything stands out that could be causing this
|
@mjbvz Yeah, no problem, here it is: https://gist.github.com/kasik96/0af966b0b28f7a118025e50f943429d8 |
+1 |
+1 Having the same issue here. One line change will spike CPU and show electron_node tsserver.js as the problem |
+1 Can confirm on Ubuntu 16.04, problem seems to be stemming from tsserver. I have nearly identical logs to kasik96. Use an older version of VSCode in the mean time instead of trying to hack this into working! |
Moving this upstream as I don't see anything that stands out in those logs. Can you please try upgrading your workspace to use |
@mjbvz Same problem, did not help. |
I have tried pretty much every solution listed here and in other gh issues. Have tried removing extensions, upgrading TS, etc.. and I'd really hate to switch to atom. Is there any fix for this? Pretty sure it's limited to linux os |
no @Mozar10, this is happening for me on MacOS as well. |
@kasik96 From your shared log it seems like file watcher being invoked too many times and is suppose to be a file not found.. Enabling
|
It happens very often (several times during a day) to me with my medium size projects, tsserver (eletron_node tsserver.js) starts to eat 30%-70% CPU on any currently active file in the editor (I see it in vscode's Process Explorer). When I restart vscode it's working fine on the same files, sometime later it begins again. It really hard to believe that there is something "wrong" with the app's TS code. Using Windows 10, latest stable VSCode, and TS stable 3.4.5 |
@SeedyROM Thanks for the tip. That didn't cross my mind and so far so good 👍 |
I have downgraded to vscode 1.32 but the problem is the same, it periodically became hight then some minutes later goes down back. |
I had the same issue when opening files in larger typescript projects. I would say it's a bug at some level, but I could make it go away by using |
This just started happening to me out of the blue in DeepinOS but I just switched a couple days ago so I'm not sure if I hadn't been paying attention and it was doing it all along. Extremely frustrating as my laptops fans start going full speed and typescript's intellisense takes forever to load instead of the instantaneous feedback I'm used to. Going into htop shows usally all CPUs having an increase in usage with one of them at 99%. I first noticed this yesterday when I tried to run Gatsby and it errored out saying I had too many file watchers. I have also tried every solution I could find and even upgraded from I believe 1.31 to 1.39 and that didn't work so finally decided to post here. I haven't enabled verbose logging and looked at the logs yet so I'll do that now and report back. Makes me so sad :(. I love VSCode too much for this to ruin my experience but there's no way I can handle my laptop sounding like a turbine and my intellisense taking 5-10 seconds to load while I type. As an aside, this only starts happening when I start typing. EDIT: And I'm running on a Lenovo Yoga 920 if that matters |
Alright, I attached my tsserver log. I REALLY hope this helps. I literally turned on verbose logging, exited VSCode, re-opened VSCode, typed a couple characters in a .tsx file and everything spiked. So this is like a log of a minute of time frame and I hope it helps point down the issue. EDIT: Apologies, that one had some extensions running. The following log has no extensions enabled. It seems to be adding file watchers to directories like node_modules?
It seems like on Linux it is ignoring these settings and they are not taking effect EDIT: I tried opening only my src/ directory so that node_modules or .cache or any of that was not even apart of it. Same issue and looking through the log, it's still checking node_modules? Forgive my ignorance on this but I assumed it would have ignored it. Damn. EDIT: Deleting node modules folder resolves the issue. Re-installing node modules causes issue to reappear LAST EDIT: I'm pretty sure I found the issue. It's the npm module react-spring. I had just added it in yesterday and removing the module gives me a lot more performance and my intellisense works flawlessly. However, when I add it is when I get the 5-10 second load times on intellisense and my CPU spikes to 100%. However, tsserver is still not avoiding file watching node_modules and my CPU use is still really high to the point that my laptop still decides to act like a wind turbine. So this issue still exists, I only noticed it after having intellisense issues. Hopefully the logs I have posted and my own debugging effort here has helped a bit. Swear my last edit: Seems like people at react-spring know about this issue and it all comes back to this bug in typescript. Thus, react-spring was essentially just the last straw for vscode to where it exploded and almost melted my cpus. So you know, this is their issue opened: pmndrs/react-spring#613 And this is the typescript bug they are referencing that they think is causing this whole mess: #29949 |
Same problem in WebStorm https://intellij-support.jetbrains.com/hc/en-us/community/posts/360003579280-IntelliJ-node-processes-using-a-lot-of-CPU-on-TypeScript-project-IntelliJ-performance-suffers-?flash_digest=13598a0eb3a2ffbcf8004d50e974872587e71957 Disabling tsserver in WebStorm fixes the excessive CPU usage |
Have been facing this exact issue as well on the latest macOS for the past few weeks and haven’t been able to solve it. |
@cushmatt can you please try typescript@next to see if the issue still repros.. We made some changes to directory watching for Linux and it might have fixed the issue with the files being watched.. |
I am still experiencing this issue with VSCode Insider and typescript@next. |
@puppeteer701 Please open a new issue with information about your project Closing this since we cannot investigate this without more info from the original poster |
Steps to Reproduce:
I tried to turn off some settings, but nothing help.
It caused by TSServer.js build-in "TypeScript and JavaScript Language Features" extension.
Solution: Disable "TypeScript and JavaScript Language Features" build-in extensions.
Does this issue occur when all extensions are disabled?: Yes
The text was updated successfully, but these errors were encountered: