25 days 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
6 Replies
allenshintani
1. Large Docker images - The built image itself might be too large2. Memory leaks - There could be memory leaks within the application3. Unoptimized images - Surprisingly common issue where images aren't being converted to efficient formats like WebP4. High replica count - Railway's minimum replica setting might be set too high5. TypeScript build issues - If using TypeScript, you might have:Redundant builds from sharing types between backend and frontendDuplicate build processesIn my experience, I was able to significantly reduce memory usage just by optimizing image sizes. What do you think about these possibilities?
24 days 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
24 days 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.
24 days ago
lark
my bill
23 days ago
What does that have to do with my issue?
allenshintani
Sorry, I'm not very good at English, so I'm using AI to translate this. I'm the one talking about the content.Webp is talking about image file extensions. In a simple web app, if you don't compress the image size, the memory size will be quite large. If you're including png or jpeg images in your deployment, I suggest using webp.
23 days 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
22 days ago
according to the 'Public network traffic' graph it seems like there was ingress traffic happening at the same time the mem spiked
22 days ago
Is the memory footprint similar if this is running locally?
21 days ago
@justkira - could provide provide a reproduction? I am on the Bun team. You can email me at conner@bun.com
20 days ago
@JustKira ^
20 days ago
Bun engineer replied to your thread asking for a reproduction
https://station.railway.com/questions/high-memory-usage-node-bun-f34a3603
20 days ago
Oh ok
20 days 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
16 days 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
16 days ago
Ah so you can't just switch back to Node to check if the memory leak is bun specific.
16 days 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.
16 days 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

16 days ago
Memory dropping after a re-deploy would be completely normal.




