10 months ago
i have 2 sevices like new has nothing just create a new sveltekit project and new hono project
Sveltekit is Using node-adpater
Hono is binary build using Bun
memory is Insanly high
On a Side note not sure if that mater im using Moonrepo which is a monorepo that Does optimized docker image well copying packages and stuff but highly dought it has anything to do with Bun or Node
i can link docker if that useful
im using Latest in both Node 24.6.0 and Bun 1.2.20
45 Replies
10 months ago
Let me Clarify something the apps are super simple, sure maybe docker build is incorrect but i dont understand what do u mean with WebP , im talking about Docker images not images plus even if docker image is large it should large in file size not like memory usage.
Plus i don't want to sound rude but it feels like ai response
5. TypeScript build issues - If using TypeScript, you might have:
Redundant builds from sharing types between backend and frontend
Duplicate build processes
im suing bun for hono which build an optmized binary anyway
10 months ago
Is the memory spike at a certain interval of code execution, during a particular function being executed, or is the pattern randomly distributed?
Can you provide the metrics graph's snippets of the past 7 days for both services (select a deployed service on Railway, & then go to the Metrics section)? This will allow us to show which service is consuming the memory.
clashing
Is the memory spike at a certain interval of code execution, during a particular function being executed, or is the pattern randomly distributed? Can you provide the metrics graph's snippets of the past 7 days for both services (select a deployed service on Railway, & then go to the Metrics section)? This will allow us to show which service is consuming the memory. 
10 months ago
10 months ago
What does that have to do with my issue?
10 months ago
Again its not realed to Images like png or webp its Docker Image not sure what AI u are using its super dumb there is no WEBP in the issue its again simple hono backend and sveltekit frontend DOCKER IMAGE
10 months ago
according to the 'Public network traffic' graph it seems like there was ingress traffic happening at the same time the mem spiked
10 months ago
Is the memory footprint similar if this is running locally?
10 months ago
@justkira - could provide provide a reproduction? I am on the Bun team. You can email me at conner@bun.com
10 months ago
@JustKira ^
10 months ago
Bun engineer replied to your thread asking for a reproduction
https://station.railway.com/questions/high-memory-usage-node-bun-f34a3603
10 months ago
Oh ok
10 months ago
no, it's good
https://github.com/JustKira/moon-repo-railway-bun-memory-issue
let me link repo here for anyone want to try
9 months ago
are you in contact with Connor from bun? have you provided them an MRE?
I Hope i don't go bankrupt before the fix because im using bun s3 client will be hard for me to remove it now
9 months ago
Ah so you can't just switch back to Node to check if the memory leak is bun specific.
9 months ago
Though, if it makes the situation better, at least memory leaks aren't Railway specific! 🙂
I’m not 100 % sure, but there was a moment when every JS service suddenly ballooned in memory and then—almost in unison—dropped back down. The spike was only about 10 %, so it was pretty minor, but I figured it might have been triggered by an update on your end. Either way, Railway’s been rock-solid for me—smooth sailing all around.
9 months ago
Memory usage is not dependent on our systems, the memory usage is solely your application's usage.
Anyway, I’ll be off having a long, heartfelt chat with my wallet until Bun sorts out that weird memory issue.
@Brody sorry to bother but why when i set limit 1gb memory dropped like that

9 months ago
Memory dropping after a re-deploy would be completely normal.




