-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Typescript process is consuming much memory and preventing suggestions at editor #58820
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
Hey there, sorry about this - this seems like an awful experience. Is this specifically a problem with only editing? Are you seeing an increase in build time as well? I don't suppose you've been able to run the results of your trace via https://github.com/microsoft/typescript-analyze-trace, have you? That will make things easier to diagnose in terms of performance, and will make it easier to understand what is slower now compared to 5.4. There is also every-ts to help figure out which commit of TypeScript introduced a regression. If you can run that to help diagnose the issue, it would be extremely helpful. |
Well actually I am not using TSC to build my project cuz it's a next.js project. As I know it's using swc to build but I don't have problems at build. Only happens at editing and typing. I am also using vscode if matters. I generated that trace i attached via vscode's tsserver traces. I checked same thing at another project and another editor and also at another OS :D , only difference was at Neovim with (coc.nvim) TS server LSP. coc-ts Also at version check i tried both vscode's TS version and my project's version (5.5, 5.4.5) both were same. What's happening basically: I am making a mistake at code then I am waiting for diagnostics, meanwhile my fans are buzzing, my CPU and memory usage increasing around 80%, I checked performance profile at vscode, i saw a similar graphic describes that problem. Here i am sharing what i see while coding: :( Here is for neovim with coc-tsserver I am okay for high resource consumption for these kind of things, however i dont know why its not ending and showing. |
Anything ? |
I used 5.5 to write that logs though, still today it's hanging for long minutes like 5min to show a diagnostic |
@devhik0 Oh okay. My bad then. It seems unrelated. Apologies for the inconvenience. |
No problem @stackyism , i don't think this problem has a solution tbh |
Anything? |
Have you tried using analyze-trace of extendedDiagnostics as mentioned here ? It actually really helped me find the Hot spots and lead me to exact files which were causing excessive computation in generics.
Note: try and give your extendedDiagnostics command a lot of memory in advance for it to not break. |
I am not using TSC @stackyism |
That's completely fine, we don't use it as well, we use nx to run our builds and it does type checking based on plugins. Does this make sense or am I misunderstanding by what you mean that you don't use TSC ? π€ these commands will just need corresponding tsconfig files used to run typescript checking. Also, just a side note, I meant I used following command to output the trace folder |
My commands are starting with |
I understand that. As per my understanding, nextJS app should have a Would you need help with that ? |
:) Thanks for your help but I think I couldn't explain myself much. Think you have vscode, you have some .TS files and editing those. While editing it's taking minutes to show diagnostics. I don't want compile, i am looking for diagnostics
|
Also check this @stackyism |
Okay. So, it looks like I understand why this might be confusing. As per the above messages, you're facing issues with Visual code not providing proper typescript intellisense due to huge computation time. Intellisense basically keeps checking your code for typescript error through ts-server which keeps compiling your code and gives you errors or recommendations. Now, I'll just try to iterate how I wanted to help.
Does this make sense or maybe I've completely misunderstood the problem here ? |
Do you have discord, i want to show you what I want actually @stackyism |
Yes. I've joined typescript discord server and have user name |
I sent request on discord, please accept that @stackyism |
I wish to discuss this with Mr.Hejlsberg, wondering his ideas always :) |
Anything? |
π Search Terms
π Version & Regression Information
β― Playground Link
No response
π» Code
// Your code here
π Actual behavior
When i make a mistake in my code, my ram usage is increasing much and intellisense is not showing errors/warnings in expected time period like 1-2 sec. Sometimes its hanging and i am waiting for minutes to see its response.
Not sure but i think that error below is causing that performance issues.
π Expected behavior
At mistakes, seeing errors/warnings in short period.
Additional information about the issue
When i check logs and traces i am seeing a lot different packages are downloading while the error-checking continues. Like this:
Trace-20240610T183642.json
Also at this process:
C:\Program Files\nodejs\node.exe" --max-old-space-size=12000 "c:\Users\aydin\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\extensions\node_modules\typescript\lib\tsserver.js" --useInferredProjectPerProjectRoot --enableTelemetry --cancellationPipeName C:\Users\aydin\AppData\Local\Temp\vscode-typescript\465f576e122de7f00782\tscancellation-f24a4ea23cca8e2de700.tmp* --traceDirectory "\"c:\Users\aydin\AppData\Roaming\Code - Insiders\logs\20240610T180039\window1\exthost\vscode.typescript-language-features\tsserver-log-7zZxSQ\"" --locale en --noGetErrOnBackgroundUpdate --canUseWatchEvents --validateDefaultNpmLocation 504.904 K
there is around 500mb memory usage, even i give 12GB to it.I could say i cant code because of these kind of problems.
The text was updated successfully, but these errors were encountered: