Jenkins build throwing an out of memory error

前端 未结 2 587
既然无缘
既然无缘 2020-12-30 02:57

We have Jenkins running on an ec2 instance. When doing a build, we see the following error:

17:29:39.149 [INFO] [org.gradle.api.Project] OpenJDK 64-Bit Serve         


        
相关标签:
2条回答
  • 2020-12-30 03:43

    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.

    0 讨论(0)
  • 2020-12-30 03:49

    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 /swapfile
    sudo chmod 600 /swapfile
    sudo mkswap /swapfile
    sudo swapon /swapfile
    

    Check again:

    free -m
    

    For more details look here

    0 讨论(0)
提交回复
热议问题