Question

Digitalocean Error while deploying "Out of Memory"

Hi Everyone,

When I build my project in Digitalocean, I encounter an “Out of Memory” error. I added 2 environment this error. 1- old_memory_size 2- GENERATE_SOURCEMAP 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.


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

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.

https://www.digitalocean.com/community/tutorials/how-to-use-top-netstat-du-other-tools-to-monitor-server-resources

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

https://www.digitalocean.com/community/questions/how-to-find-the-processes-that-are-consuming-the-most-server-resources

Hope that this helps! Regards, Alex