Start Building for Free
CircleCI.comAcademyBlogCommunitySupport

Configuring the JVM Heap Size

2 months ago1 min read
Server v2.x
Server Admin
On This Page
  • Setting up
  • Verify customization is applied

The JVM heap size is configurable for the following containers: frontend, test-results, output-processing and contexts-service. You might want to consider increasing the heap size if you see "out of memory" errors, such as: Terminating due to java.lang.OutOfMemoryError: Java heap space.

Setting up

To be able to configure the JVM_HEAP_SIZE value for each container, you will first need to create customizations files on your services machine.

  1. Create customizations files:

    /etc/circleconfig/frontend/customizations
    /etc/circleconfig/test-results/customizations
    /etc/circleconfig/output-processor/customizations
    /etc/circleconfig/contexts-service/customizations
  2. In each customization file add the line below to export your desired JVM heap size:

    export JVM_HEAP_SIZE=2g
  3. Stop and restart CircleCI application from the Management Console dashboard (for example, your-circleci-hostname.com:8800)

Verify customization is applied

Once your installation has successfully restarted, you can confirm the configured value was applied correctly by running the following REPL commands per container:

  • frontend

    sudo docker exec -it frontend lein repl :connect 6005
  • test-results

    sudo docker exec -it test-results lein repl :connect 2719
  • output-processing

    sudo docker exec -it picard-output-processor lein repl :connect 6007

And following are the outputs you should see:

(System/getenv "JVM_HEAP_SIZE") ;; should return what you have set above
(-> (java.lang.Runtime/getRuntime) (.maxMemory)) ;; return value should match with JVM_HEAP_SIZE

Help make this document better

This guide, as well as the rest of our docs, are open source and available on GitHub. We welcome your contributions.

Need support?

Our support engineers are available to help with service issues, billing, or account related questions, and can help troubleshoot build configurations. Contact our support engineers by opening a ticket.

You can also visit our support site to find support articles, community forums, and training resources.