payload:build causing Out Of Memory exception in production #150
-
I got a slight issue meaning that sometimes the application doesn't build on my DigitalOcean application. I'm not sure if it's down to DigitalOcean but I've got a 4GB instance so I feel like that should be enough. I was just wondering if there is any way of limiting the amount of memory that payload:build consumes? Can I pass any node options to it? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
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. Maybe give some of those ideas a shot? I would be thrilled to hear what works! |
Beta Was this translation helpful? Give feedback.
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…