-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
esbuild watch caused high disk i/o #750
Comments
Thanks for the report. Watch mode uses polling so it relies on your operating system to keep file metadata in RAM. I have no idea what the Docker <-> WSL2 <-> Windows file system driver setup is like but I could imagine it not caching stuff effectively. FWIW you don't need to use esbuild's built-in watch mode if you don't want to or if it's not working for you. Feel free to use esbuild's build API with any of the many other file watching libraries out there. Some other well-known ones are watchexec and chokidar. |
Except for this one moment, esbuild's watch has been working beautifully (in containers and windows itself) |
I want to report what I assume is a related problem: After starting esbuild in watch mode, it continually keeps increasing RAM usage by about 1-2 MB per second (!). My OS is Ubuntu, but this was also experienced by a co-worker with another Linux distro. We noticed it when his laptop was brought to its knees, with 4 GB RAM usage by esbuild alone ;) |
Ah wow ok that's terrible. I haven't experienced that myself but I'll try to reproduce it. Edit: That was dumb. The GC is just off when using |
Good find! Though I don't think that's my issue. I'll make a fork of esbuild that runs a pprof server so that I can get more information for you if I'm un/lucky enough to hit this again. |
I have happily adopted esbuild and started using it for new projects. A couple days after I first tried it and complained there was no watch mode, watch mode was released -- thank you! ❤️
This morning I had watch mode running on a project and noticed my computer slowed down a good deal. I opened task manager and saw the esbuild was thrashing the disk pretty hard.
The command was:
It had been running fine for several hours previously, and after restarting it it went back to normal; unfortunately I don't have a reproduction. And didn't have the wherewithal at the time to try to collect any sort of traces before killing it, but I wanted to let you know regardless.
This was running inside an Ubuntu Docker container using Docker's WSL2 backend.
The text was updated successfully, but these errors were encountered: