Memory Settings

Memory usage varies depending on whether or not the CloudBees Flow server is a dedicated machine.

  • a CloudBees Flow server running on a dedicated machine has a default minimum heap memory allocation of 20% and a maximum heap memory allocation of 40%. This applies to either a 32 or 64-bit system.

  • In general, a CloudBees Flow agent has a default minimum memory usage of 16 MB and a maximum memory usage of 64 MB. However, agents for REPO-server, Web-Server and Proxy agents needing higher settings; for details, see the KBEC-00248 - Agent Memory Configuration Knowledge Base article.

Modifying Memory Settings for a CloudBees Flow Server

There are two ways you can adjust the amount of memory for the CloudBees Flow 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 2008

c:\ProgramData\ElectricCloud\ElectricCloudCommander\conf\wrapper.conf

Windows 7

Linux

`/opt/electriccloud/electriccommander/conf/wrapper.conf

Repository

Windows 2008

c:\ProgramData\Electric Cloud\ElectricCommander\conf\repository\wrapper.conf

Windows 7

Linux

`/opt/electriccloud/electriccommander/conf/repository/wrapper.conf

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

    For example, to set the CloudBees Flow 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 Flow Agent

To adjust the amount of memory for the CloudBees Flow 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\Electric Cloud\ElectricCommander\conf\agent\wrapper.conf

  • Linux: `/opt/electriccloud/electriccommander/conf/agent/wrapper.conf

Modifying Memory Settings for a Containerized CloudBees Flow Server or CloudBees Flow Repository Server

By default, the initial memory and maximum memory for the CloudBees Flow 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/electriccloud/electriccommander/conf/wrapper.conf file for the CloudBees Flow server and CloudBees Flow repository server to use absolute values (in MB) instead of using the wrapper.java.initmemory.percent and wrapper.java.maxmemory.percent settings.

Making the CloudBees Flow Server JVM Aware of 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 Initial and Maximum Memory Settings for a Containerized CloudBees Flow Server or CloudBees Flow Repository Server

To configure the CloudBees Flow server and repository server Java processes to use absolute values:

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

docker exec -it <container_name> bash

+
where `<container_name>` is the name of your CloudBees Flow server or repository server container. For example, enter:
+

docker exec -it efserver bash

. 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`, see xref:automation-platform:installed-tools.adoc[CloudBees Flow Installed Tools].

////
{
    "format": "annotations-1",
    "annotations": [
        {
            "id": "annotation-001",
            "props": {
                "createDate": "2019-10-28T14:40:07.4018599-07:00",
                "creator": "patriciahair",
                "initials": "PA",
                "comment": "Not able to find this KB on support.cloudbees.com, so conditioning it out.",
                "editor": "patriciahair",
                "editDate": "2019-10-28T14:40:37.7008588-07:00"
            },
            "content": "For more information, see the KBEC-00376 - Making the CloudBees Flow Server JVM Aware of Docker Container Memory Limits knowledge base article. CloudBees Flow 8.0.1 and later versions include JRE build 1.8.0_131-b11 to provide this capability"
        },
        {
            "id": "annotation-002",
            "props": {
                "createDate": "2019-10-28T14:43:05.2628373-07:00",
                "creator": "patriciahair",
                "initials": "PA",
                "comment": "Cannot find this in support.cloudbees.com",
                "editor": "patriciahair",
                "editDate": "2019-10-28T14:43:13.5979044-07:00"
            },
            "content": "see the KBEC-00387 - Configuring Initial and Maximum Memory Settings for a Containerized CloudBees Flow Server or CloudBees Flow Repository Server knowledge base article"
        }
    ]
}
////
Copyright © 2010-2020 CloudBees, Inc.Online version published by CloudBees, Inc. under the Creative Commons Attribution-ShareAlike 4.0 license.CloudBees and CloudBees DevOptics are registered trademarks and CloudBees Core, CloudBees Flow, CloudBees Flow Deploy, CloudBees Flow DevOps Insight, CloudBees Flow DevOps Foresight, CloudBees Flow Release, CloudBees Accelerator, CloudBees Accelerator ElectricInsight, CloudBees Accelerator Electric Make, CloudBees CodeShip, CloudBees Jenkins Enterprise, CloudBees Jenkins Platform, CloudBees Jenkins Operations Center, and DEV@cloud are trademarks of CloudBees, Inc. Most CloudBees products are commonly referred to by their short names — Accelerator, Automation Platform, Flow, Deploy, Foresight, Release, Insight, and eMake — throughout various types of CloudBees product-specific documentation. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Jenkins is a registered trademark of the non-profit Software in the Public Interest organization. Used with permission. See here for more info about the Jenkins project. The registered trademark Jenkins® is used pursuant to a sublicense from the Jenkins project and Software in the Public Interest, Inc. Read more at www.cloudbees.com/jenkins/about. Apache, Apache Ant, Apache Maven, Ant and Maven are trademarks of The Apache Software Foundation. Used with permission. No endorsement by The Apache Software Foundation is implied by the use of these marks.Other names may be trademarks of their respective owners. Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in this content, and CloudBees was aware of a trademark claim, the designations have been printed in caps or initial caps. While every precaution has been taken in the preparation of this content, the publisher and authors assume no responsibility for errors or omissions, or for damages resulting from the use of the information contained herein.