Memory settings

2 minute readReference

Memory usage varies depending on whether the CloudBees CD/RO server is a dedicated machine. Refer to CloudBees CD/RO server and agent requirements for sizing details.

Modifying memory settings for a CloudBees CD/RO server

There are two ways you can adjust the amount of memory for the CloudBees CD/RO server.

  • Modify the wrapper.java.initmemory.percent and wrapper.java.maxmemory.percent lines in wrapper.conf

    Use the following table to determine the correct directory path.

Server Type System Path

Non-repository

Windows

c:\ProgramData\CloudBees\Software Delivery Automation\conf\wrapper.conf

Linux

/opt/cloudbees/sda/conf/wrapper.conf

Repository

Windows

c:\ProgramData\CloudBees\Software Delivery Automation\conf\repository\wrapper.conf

Linux

/opt/cloudbees/sda/conf/repository/wrapper.conf

  • Use ecconfigure to set the initial and maximum memory settings.

    For example, to set the CloudBees CD/RO Server initial memory percentage to 21% and the maximum memory percentage to 31%, enter the following command:

    ecconfigure --serverInitMemory 21 --serverMaxMemory 31

Modifying memory settings for a CloudBees CD/RO agent

To adjust the amount of memory for the CloudBees CD/RO agent, modify the wrapper.java.initmemory.percent and wrapper.java.maxmemory.percent lines in wrapper.conf for the agent. Use the appropriate directory path:

  • Windows: C:\ProgramData\CloudBees\Software Delivery Automation\conf\agent\wrapper.conf

  • Linux: /opt/cloudbees/sda/conf/agent/wrapper.conf

Modifying memory settings for containerized servers

By default, the initial memory and maximum memory for the CloudBees CD/RO server and repository server JVMs are configured as percentages of the total system memory. However, if these servers are running in a container, their JVMs cannot see the container’s total system memory.

To fix this problem, you can either:

  • Make the JVM aware that it is running in a Docker container and observe the container memory limits.

  • Modify the settings in the /opt/cloudbees/sda/conf/wrapper.conf file for the CloudBees CD/RO server and CloudBees CD/RO repository server to use absolute values (in MB) instead of using the wrapper.java.initmemory.percent and wrapper.java.maxmemory.percent settings.

Docker container memory limits

As of Java SE 8u131, and in JDK 9, you can transparently set a maximum Java heap for Docker memory limits. To make the JVM aware of these limits if you do not set a maximum Java heap via -Xmx, you must use two experimental JVM command line options:

-XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap

Configuring memory settings for containerized servers

To configure the CloudBees CD/RO server and repository server Java processes to use absolute values:

  1. Open a Bash session in the container by entering:

    docker exec -it <container_name> bash

    where <container_name> is the name of your CloudBees CD/RO server or repository server container. For example, enter:

    docker exec -it efserver bash
  2. Enter the following command:

    ecconfigure --serverInitMemoryMB=<megabytes> --serverMaxMemoryMB=<megabytes>

    or

    ecconfigure --repositoryInitMemoryMB=<megabytes> --repositoryMaxMemoryMB=<megabytes>

    For example, enter:

    ecconfigure --serverInitMemoryMB=4096 --serverMaxMemoryMB=6144

    or

    ecconfigure --repositoryInitMemoryMB=512 --repositoryMaxMemoryMB=1024

Select the maximum values based on your usage requirements. The server service restarts and begins using the new settings.

For information about using ecconfigure, refer to CloudBees CD/RO utility and tools.