Configuring the JVM Heap Size
This document is intended for system administrators of self-hosted installations of CircleCI Server.
The JVM heap size is configurable for the following containers:
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.
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.
Create customizations files:
/etc/circleconfig/frontend/customizations /etc/circleconfig/test-results/customizations /etc/circleconfig/output-processor/customizations /etc/circleconfig/contexts-service/customizations
In each customization file add the line below to export your desired JVM heap size:
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:
sudo docker exec -it frontend lein repl :connect 6005
sudo docker exec -it test-results lein repl :connect 2719
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