Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Out of memory with npm run build

I have a react project, about 40MB. I run 'npm run build' with the param --max-old-space-size=4096.

At my local, about 8GB RAM, the build is running fine. But on Jenkins (AWS EC2 hosted one, t2.medium) 4GB, either 'Out Of Memory' or crash EC2 instance.

Please advice if any way we can overcome on Jenkins 4GB RAM.

Thanks,

like image 829
Nghia Do Avatar asked Dec 07 '25 08:12

Nghia Do


1 Answers

You should also check if there aren't any other apps eating out the memory on that EC2 instance. Because the react build itself, consuming 4 GB of memory, in a small project, is much unlikely to happen!

This thread might help you: How to monitor EC2 instances by memory?

like image 140
Todor Popov Avatar answered Dec 10 '25 02:12

Todor Popov