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

Abnormal file system usage on macOS while running TypeScript #54683

Closed
guillermo-avalos opened this issue Jun 16, 2023 · 5 comments
Closed

Abnormal file system usage on macOS while running TypeScript #54683

guillermo-avalos opened this issue Jun 16, 2023 · 5 comments
Labels
Duplicate An existing issue was already created

Comments

@guillermo-avalos
Copy link

Bug Report

🔎 Search Terms

fs_usage, file system usage

🕗 Version & Regression Information

5.1.3, but also happening with earlier versions.

🙁 Actual behavior

Endless loop of fs_usage activity.
To Reproduce:

  1. Create a new, blank Next.js project with npx create-next-app@latest (although any TS project will do)
  2. Run sudo fs_usage -w | grep 'Users/[username]/[project-location]/' --line-buffered to capture macOs' filesystem activity.
  3. Open the project in Visual Studio Code. Immediately after opening a few config files (although it's completely random), the filesystem usage will start an endless loop as you see in my screen capture.

Screen capture of the issue: https://share.cleanshot.com/SYpRks7p

🙂 Expected behavior

This issue seems to be related to TypeScript. If I use a different code editor, such as Nova from Panic, that allows me to fully disable TS, the problem goes away. File system activity returns to normal. Immediately upon enabling TypeScript support, the loop starts yet again.

@jakebailey
Copy link
Member

Given your description, likely this is #52535 and #52876.

Can you set:

"typescript.tsserver.watchOptions": {
    "watchFile": "fixedPollingInterval"
},

And see if this helps?

@guillermo-avalos
Copy link
Author

Thanks @jakebailey. Adding that to VS Code config.json did make a change, the polling is still several times a second but now I'm seeing actual files from my projects. It's mostly node_modules and several other directories and files.
It this how TS is supposed to work? The polling seems excessive. Any other suggestions?

@jakebailey
Copy link
Member

There are other file watching methods that can be passed to that option; I just randomly chose one. You can also try dynamicPriorityPolling. The default was changed in #50366.

File watching is fickle and we're working on this. Marking as a duplicate.

@jakebailey jakebailey added the Duplicate An existing issue was already created label Jun 16, 2023
@guillermo-avalos
Copy link
Author

Awesome. I'm glad this isn't only happening to me. I understand that file watching is necessary, just surprised that TS needs to watch every file randomly several times a second.

@typescript-bot
Copy link
Collaborator

This issue has been marked as 'Duplicate' and has seen no recent activity. It has been automatically closed for house-keeping purposes.

@typescript-bot typescript-bot closed this as not planned Won't fix, can't repro, duplicate, stale Jun 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Duplicate An existing issue was already created
Projects
None yet
Development

No branches or pull requests

3 participants