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

[Bug]: HMR Memory leak when saving rsbuild.config.ts multiple times #2288

Open
hussain-nz opened this issue May 9, 2024 · 8 comments
Open
Labels
🐞 bug Something isn't working

Comments

@hussain-nz
Copy link

Version

System:
    OS: Windows 10 10.0.19045
    CPU: (16) x64 AMD Ryzen 7 5800H with Radeon Graphics
    Memory: 27.91 GB / 39.39 GB
  Browsers:
    Edge: Chromium (123.0.2420.97)
    Internet Explorer: 11.0.19041.3636
  npmPackages:
    @rsbuild/core: 0.6.13 => 0.6.13
    @rsbuild/plugin-eslint: 0.6.13 => 0.6.13
    @rsbuild/plugin-react: 0.6.13 => 0.6.13
    @rsbuild/plugin-type-check: 0.6.13 => 0.6.13

Details

Running dev server and changing the rsbuild.config.ts causes the memory to jump up 2-4gb at a time, eventually reaching the machine's maximum memory limit and slowing down HMR from 10 seconds to 1+ minutes. Attached a video to show this happening.

Reproduce link

Video attached

Reproduce Steps

  1. rsbuild dev
  2. Change rsbuild.config.ts multiple times
  3. Notice that memory for the rsbuild process is jumping up too much and reaching maximum after 5-10 file changes saved.
2024-05-09_14h03_41.mp4
@chenjiahan
Copy link
Member

Thanks for the report, we will try to reproduce and fix this.

@SoonIter
Copy link
Member

SoonIter commented Jun 8, 2024

I can't confirm whether this problem is in both mac or win. On my mac, config reload is more obvious than hmr memory.

But there is no jump such as a one-time increase of 2-4GB.

image

@TianJianJun0727
Copy link

image Rsbuild v0.7.10 仅打开Webstorm运行一个前端项目 开发环境构建失败后再次使用npm工具重新构建,多次之后Node内存占用就10-20GB了,占用内存主要是运行的Rsbuild项目

@SoonIter
Copy link
Member

SoonIter commented Aug 9, 2024

Rsbuild v0.7.10 仅打开Webstorm运行一个前端项目 开发环境构建失败后再次使用npm工具重新构建,多次之后Node内存占用就10-20GB了,占用内存主要是运行的Rsbuild项目

This problem cannot be reproduced in my machine. Can you provide a minimum reproduction?
Excluding the impact of webstorm or vscode, you can reproduce it on vscode.

@ahqsoftwares
Copy link

The same happens on my machine too, windows

@ahqsoftwares
Copy link

Image

@SoonIter
Copy link
Member

The same happens on my machine too, windows

hey, can you confirm that this happened after #3261 (1.0.1-beta.16)?

@ahqsoftwares
Copy link

ahqsoftwares commented Oct 28, 2024

The same happens on my machine too, windows

hey, can you confirm that this happened after #3261 (1.0.1-beta.16)?

I am currently at @rsbuild/core 1.0.17

Also, a discovery, removing watchFiles reduces the intensity of the memory leak

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants