-
-
Notifications
You must be signed in to change notification settings - Fork 19
Vite 8.0.0-beta.9 dev server uses ~4x more memory than Vite 5.4.21 #577
Description
Describe the bug
Hey team! First off, thanks for all the work on Vite 8 and Rolldown — really excited about the new architecture!
I noticed something while testing the beta: Vite 8.0.0-beta.9 seems to be using significantly more memory than Vite 5.4.21 when running the same project. I ran both versions side-by-side to compare, and wanted to share my findings in case it's helpful.
Vite 5.4.21 + esbuild (running for 4 days):
| Process | Memory |
|---|---|
| Vite dev server (app-a) | 170 MB |
| Vite dev server (app-b) | 127 MB |
| esbuild | 127 MB |
| esbuild | 96 MB |
| Total | ~520 MB |
Vite 8.0.0-beta.9 + Rolldown:
| Process | Memory | Uptime |
|---|---|---|
| Vite dev server (app-a) | 1,142 MB | ~37 seconds |
| Vite dev server (app-a child?) | 45 MB | ~37 seconds |
| Vite dev server (app-b) | 598 MB | ~7 hours |
| Total | ~1.8 GB |
The key finding: Vite 8 uses 1.1GB after just 37 seconds of running, while Vite 5 stays at ~520MB after 4 days of continuous use. This suggests it's not a gradual memory leak, but rather a very high baseline memory consumption.
The app-b process at 598 MB after 7 hours also suggests there may be some memory growth over time on top of the high baseline.
I'm not sure if this is expected due to the new Rolldown architecture, or if there might be room for optimization. Thought I'd flag it either way!
Reproduction
I can't share the exact repo, but it's a React + TypeScript monorepo with:
- 2 separate apps (entry points)
- ~500+ components
- Standard dependencies (React, React Router, etc.)
This should be reproducible with any medium-to-large React project by comparing Vite 5.x vs 8.0.0-beta.9.
Steps to reproduce
- Run
vitedev server with version 5.4.21 on a medium/large project - Run
vitedev server with version 8.0.0-beta.9 on the same project - Monitor memory usage with
topor Activity Monitor immediately after startup - Compare memory consumption — the difference should be visible within seconds
Expected behavior
I'd expect memory usage to be roughly similar between versions — or ideally better with Rolldown!
Actual behavior
Vite 8.0.0-beta.9 uses about 1.1GB within the first minute of startup, compared to ~300MB for Vite 5.4.21. That's roughly 4x more memory for the same project right from the start.
System Info
System:
OS: macOS 14.5
CPU: Apple M1 Pro
Memory: 16 GB
Binaries:
Node: 22.21.1
npmPackages:
vite: 8.0.0-beta.9 (comparison against 5.4.21)
Used Package Manager
bun
Validations
- Follow the Code of Conduct
- Read the Contributing Guidelines
- Read the docs
- Check that there isn't already an issue that reports the same bug
- Make sure this is a Vite issue and not a framework-specific issue
Additional context
I saw that vitejs#21451 (event emitter leak) was fixed in beta.9 — nice catch! The high memory usage still persists though, so there might be other areas worth looking into.
Also came across vitejs#20155 (HMR memory leak) which might be related to the gradual growth I observed in longer-running processes.
Happy to provide more details or run additional tests if that would help. Thanks again for all your work on this! 🙏