Jenkins build throwing an out of memory error Jenkins build throwing an out of memory error jenkins jenkins

Jenkins build throwing an out of memory error


I've sold the same problem. (I have ec2, t2.micro, Ubuntu 14, Jenkins, Tomcat, Maven).By default you don't have swap space.To confirm this:

free -m

Just add some. Try with 1 GB for begin.

sudo fallocate -l 1G /swapfilesudo chmod 600 /swapfilesudo mkswap /swapfilesudo swapon /swapfile

Check again:

free -m

For more details look here


This is not a memory issue on JVM level, but on OS level. The JVM tries to allocate 224MB, but this amount of memory isn't available on OS level. This happens when the -Xmx settings of a JVM are larger than the amount of free memory in a system. Check the amount of free memory in the OS, and either limit the memory of your current JVM so that fits within the free memory, or try to free up memory (by limiting the amount of memory other processes use) or try out an EC2 instance with more memory.