Deploy Logs show out of heap memory
My server runs fine locally, but only in Railway it fails to deploy and shows the following attached messages.
The build phase works fine.
31 Replies
Project ID:
00a98625-f237-4950-bfaa-f6b77695df8c
00a98625-f237-4950-bfaa-f6b77695df8c
I made sure the node version is the same as my local with environment variable
NIXPACKS_NODE_VERSION
which is version 18
I'm seeing
nodejs-20.6.1
in multiple places in those logsOh sorry that is an old log. Let me get you new one with the
NIXPACKS_NODE_VERSION
update.what do your memory metrics look like
Oh weird... Even though my build log says I'm using
nodejs_18
at the top, my deployment log has 20
like you said.I guess docker runtime environment is Node
20
?1.9gb image??
what do your memory metrics look like
Where did you see 1.9gb image?
your build logs
Oh you mean the docker image.
When I start up my server locally, it uses up about
1GB
of RAM memory.what do your memory metrics look like on railway
My server never started up properly. The out of memory message shows up immediately when
yarn start
is executed.fair
My guess is that the Memory metrics is the memory usage during the run time of the server?
increase the heap size?
I can but that worries me. I've used Railway for multiple projects with similar code base and never had to do that.
Weird... I will try increasing the heap size.
not really sure what to tell you then, this isn't an issue with Railway and there's not much to go off of
True
Trying now with increased heap size
what's the max heap size we get anyway?
whatever the default for node 18 is
I mean from Railway.
Per docker container
I know
if you're asking about ram, that's 8gb as per your plan
ok thanks
I tried 4GB and the there wasn't enough system memory and got killed
Does running a Postgres with the server service have an impact on the system RAM?
Trying out
2048
(2GB) now.
Yeah 2048
also gets killed immediately... as well with code 137
@Brody Could I get some help why my current plan on Railway allows up to 8GB RAM
but I can't give even 2GB
to my Node server when I start it up?
Ok I'm gonna pay the $20
and try to get the 32GB RAM
per service and see if I get start the server with enough memory...
If getting the Railway Pro and it doesn't solve the issue I honestly don't know what to do at this point...Solution
Ok, now that's working great after getting
32GB
was sleeping, but some things to note
Does running a Postgres with the server service have an impact on the system RAM?nope, each service can use up to what your plan allows for
Could I get some help why my current plan on Railway allows up toI honestly wouldn't know8GB RAM
but I can't give even2GB
to my Node server when I start it up?
Ok, now that's working great after getting 32GB
guess that means your app was trying to allocate more than 8gb of ram during start? what does the app do during start?My app doesn't do anything. I did a memory profiling using
chrome://inspect
to take heap dump and it said (string)
and (compiled code)
takes the most amount of memory. I guess all the libraries I am installing brings in so much crap.
On the side note... now I am having hard time exposing my server public. My server binds to the port specified by PORT
environment variable. I now added the PORT
env variable in Server settings and trying to see if I can access the server using that port.you can only access your http app externally via https on port 443
give this a read https://docs.railway.app/troubleshoot/fixing-common-errors
ah ok got it thanks.
It's all working now.
awesome!