High ram usage with mongoose and bun
anonymousdude10
HOBBYOP

4 months ago

I experience high ram usage when using bun, express and mongoose on railway. It would start at 150mb then go up too 600mb over a few hours.

I thought it was just me and my code but I have found other people experiencing the same issue using bun, could railway find a fix for it when deploying to the platform?

https://github.com/oven-sh/bun/issues/12117

Solved$10 Bounty

4 Replies

anonymousdude10
HOBBYOP

4 months ago

37f1c40e-72ad-4d1f-94bf-06dc9f757139


brody
EMPLOYEE

4 months ago

Hello,

As much as we would like to be able to do something here, memory leaks in user applications are far outside of our control.

This is something you would have to debug on your end.


anonymousdude10
HOBBYOP

4 months ago

Yeah I understand, I just saw a screenshot of someone else having the same issue on railway and thought it might've been just railway issue.


brody
EMPLOYEE

4 months ago

Fortunately, memory leaks are not exclusive to Railway.


anonymousdude10
HOBBYOP

4 months ago

Completely agree.


Could you provide me with a reproduction? You can email me at conner@bun.com


connerlphillippi

Could you provide me with a reproduction? You can email me at conner@bun.com

anonymousdude10
HOBBYOP

a month ago


fra
HOBBY

a month ago

What I'd suggest it to do take a snapshot of the app just after the start, run some load test script, take another snapshot, run the load test script, take another snapshot and investigate if you can fins something useful in the snapshots.... (you might need to run 5/10k requests to see something)

I hope is ok to share an external link:
https://kentcdodds.com/blog/fixing-a-memory-leak-in-a-production-node-js-app

but this can give you a bit more context and maybe teaching you how to debug memory leaks


fra

What I'd suggest it to do take a snapshot of the app just after the start, run some load test script, take another snapshot, run the load test script, take another snapshot and investigate if you can fins something useful in the snapshots.... (you might need to run 5/10k requests to see something)I hope is ok to share an external link:https://kentcdodds.com/blog/fixing-a-memory-leak-in-a-production-node-js-appbut this can give you a bit more context and maybe teaching you how to debug memory leaks

anonymousdude10
HOBBYOP

a month ago

It's an issue with bun not my code, other people are also having the same issue https://github.com/oven-sh/bun/issues/12117.


Status changed to Solved samgordon about 1 month ago


Status changed to Open samgordon about 1 month ago


Status changed to Solved samgordon about 1 month ago


Loading...