Skip to content

payload:build causing Out Of Memory exception in production #150

Answered by jmikrut
richardvanbergen asked this question in Q&A
Discussion options

You must be logged in to vote

Good question!

I'm actually not sure, but we've seen similar issues with other Webpack projects in the past with DigitalOcean droplets. We solved our issues by using a swapfile:

https://www.digitalocean.com/community/tutorials/how-to-add-swap-space-on-ubuntu-20-04

I know they say that swapfiles cause SSD performance degradation, but they are a mainstay of *nix operating systems and I think DigitalOcean just says this in their own best interests. We have them running on most (all?) of our droplets.

Otherwise, it looks like there are a bunch of ways to cap Node's memory usage, but I have never done it before.

npm/npm#12238

Maybe give some of those ideas a shot? I would be thrilled to hear w…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@richardvanbergen
Comment options

@jmikrut
Comment options

@richardvanbergen
Comment options

Answer selected by zubricks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants