-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Memory leak on Nuxt SSR #14389
Comments
My guess is the socket object in our node:http imlementation needs to do some additional cleanup work that it is not currently doing. In #14384: protectedObjectTypeCounts: {
Promise: 20001,
UnlinkedProgramCodeBlock: 32,
UnlinkedModuleProgramCodeBlock: 26,
Function: 9,
DebugHTTPServer: 1,
GlobalObject: 1,
Timeout: 1,
}, In main:
Note how in both cases, the Promise and the Headers/Request/Response are all still there. Something is keeping it alive forever. It's probably not emitting the close event. |
Any estimations when this could be resolved? IMO memory leaks and stability should be very high priority. |
Does it make any difference if you set nitro preset in your nuxt config
|
What version of Bun is running?
1.1.29
What platform is your computer?
windows WSL - docker
What steps can reproduce the bug?
Run project in the docker
docker build -t memoryLeak .
and
docker run -p 3000:3000 memoryLeak
Visit the page multiple times. You can use a tool like OHA to make a lot of requests. And run a command
oha -c 2 -n 10000 --disable-keepalive http://localhost:3000
in the other console type
docker stats [container name]
You can see memory usage
after 10000 requests
after 100000 requests
What is the expected behavior?
If you edit dockerfile to run app with a Node instead of bun
Memory usage in node after 100000 requests
The difference is obvious.
What do you see instead?
No response
Additional information
In package.json in scripts you can put
"debug:bun": "bun run build && bun --inspect .output/server/index.mjs"
and when you run
bun run debug:bun
in console you will see a URL for inspection. It could help with debugging the process, creating snapshots, etc...The text was updated successfully, but these errors were encountered: