Memory continuously increasing in Hono server with Bun
alex-delia
PROOP

6 months ago

Ever since a release on Aug 31 memory has been steadily increasing. I have done a ton of digging and testing and dont see any memory leaks in the code. I also havent been able to reproduce the increase in memory locally. The project is just a simple honoJS server running on Bun. Any help confirming if this could possibly be an issue on railway's end would be greatly appreciated! Thanks

Versions -

"hono": "^4.7.1",

Attachments

$10 Bounty

6 Replies

Railway
BOT

6 months ago

Hey there! We've found the following might help you get unblocked faster:

If you find the answer from one of these, please let us know by solving the thread!


6 months ago

Hey there!
I'm honestly not sure that theres much Railway can confirm to verify if this is a platform or service related issue.
Usually these types of things are service issues. Are you running via nixpacks/railpacks or with a Dockerfile?


noahd

Hey there!I'm honestly not sure that theres much Railway can confirm to verify if this is a platform or service related issue. Usually these types of things are service issues. Are you running via nixpacks/railpacks or with a Dockerfile?

alex-delia
PROOP

6 months ago

I'm running via Railpack





Super odd that each deployment is starting at a completely different level of memory. I also just redployed the version that was not having issues before Sept 1 and it seems to be replicating the same behaviour.


alex-delia

I'm running via RailpackSuper odd that each deployment is starting at a completely different level of memory. I also just redployed the version that was not having issues before Sept 1 and it seems to be replicating the same behaviour.

6 months ago

That is very odd.
As I mentioned, these types of issues are most likely because of service and are not related to platform.
Some projects I've seen running a similar stack do not encounter these types of issues.

As for service, this does look fairly linear so if your app is obtaining consistently more information it could be holding in memory and not dropping when needed.
Without a deep dive I can't really give a solid "there's your issue right there!" answer. (As much as I wish I could)

Another suggestion to improve runtime optimization is to use a custom Dockerfile! Allows for a slimmer runtime version, more optimized control, etc.


noahd

That is very odd. As I mentioned, these types of issues are most likely because of service and are not related to platform. Some projects I've seen running a similar stack do not encounter these types of issues. As for service, this does look fairly linear so if your app is obtaining consistently more information it could be holding in memory and not dropping when needed. Without a deep dive I can't really give a solid "there's your issue right there!" answer. (As much as I wish I could)Another suggestion to improve runtime optimization is to use a custom Dockerfile! Allows for a slimmer runtime version, more optimized control, etc.

alex-delia
PROOP

6 months ago

hmmm okay im going to continue to monitor the redeployed version of the code the that was running stable and see if memory continues to climb, since as you can see in the 30 day view, was running consistently at around 220mb


fra
HOBBYTop 10% Contributor

6 months ago

Any cache? Did you try stressing the app locally and do a memory snapshot?


Loading...