Configuring the JVM Heap Size
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.
-
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:
export JVM_HEAP_SIZE=2g
-
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