Digitalocean Error while deploying "Out of Memory"

Posted January 11, 2022 100 views
DigitalOceanDeploymentReactDigitalOcean Droplets

Hi Everyone,

When I build my project in Digitalocean, I encounter an “Out of Memory” error. I added 2 environment this error.
1- oldmemorysize
but I couldn’t find a solution.

My project is React project. and I have to add components as “Static”. and my plan is “Starter plan” , I use yarn for package manager. here is my build script: “NODE_OPTIONS=–max-old-space-size=8096 env-cmd -f .env.staging react-app-rewired build”

Thanks in advance for your answers.

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer

Hello, @cagdasc

I will recommend you examine the server’s performance while deploying the React application. You can use top, htop or other tools and check which service is consuming the memory on your droplet. You can then try to optimize the performance (if possible) or upgrade the droplet if this is needed.

You can also follow our tutorial on How To Use Top, Netstat, Du, & Other Tools to Monitor Server Resources. You can check the How Do I Find Out How Much of My Memory Is In Use?“ part of the article.

Another thing to check is this question that was previously asked in our community:

Hope that this helps!

by Justin Ellingwood
Monitoring a server's resources is an important task for every administrator. There are many command line tools made for this purpose. This guide will cover some of the more popular utilities for monitoring your VPS.