You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
bun install
bun start
# then start requesting it and check the heapstats logs on the server
curl http://localhost:3010/
autocannon -c 30 -d 30 http://localhost:3010
What is the expected behavior?
Memory should be going down, after a while, at approx. the level of the beginning of the server (first request)
What do you see instead?
memory is going down just a little (GC), but stays really high
A memory leak is indefinite growth in memory usage. 70 MB -> 100 MB is not clearly a leak. If you can make it go from 70 MB -> 1 GB, and then continue rising after receiving the same request volume then that is a leak.
What version of Bun is running?
1.1.22-canary.42+bec04c734
What platform is your computer?
Darwin 23.5.0 arm64 arm
What steps can reproduce the bug?
I made a small reproduction project with bun + fastify + prisma (sqlite):
https://github.com/goldo/bun-memory
bun install bun start # then start requesting it and check the heapstats logs on the server curl http://localhost:3010/ autocannon -c 30 -d 30 http://localhost:3010
What is the expected behavior?
Memory should be going down, after a while, at approx. the level of the beginning of the server (first request)
What do you see instead?
memory is going down just a little (GC), but stays really high
Additional information
This is a following issue of #7377
Investigation of potential bun memory leak
heapStats().objectTypeCounts check:
at the beginning:
$ bun start # curl http://localhost:3010 708 2252 7658
after
autocannon -c 30 -d 30 http://localhost:3010
:After a few minutes (waiting for GC), the objectTypeCounts seems still high, and the memory usage is still high (101mb) vs initial (71mb):
# curl http://localhost:3010 17515 51800 15549
The problem seems to be the same with or without the fastify plugin.
The text was updated successfully, but these errors were encountered: