# Containerized ActiveGate change memory limits

**URL:** <https://community.dynatrace.com/t/containerized-activegate-change-memory-limits/52387>\
**Category:** Container platforms\
**Tags:** activegate, dynatrace-operator\
**Created:** [July 7, 2025, 2:48pm UTC](https://community.dynatrace.com/t/containerized-activegate-change-memory-limits/52387 "2025-07-07T14:48:40Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michael\_M](https://avatars.discourse-cdn.com/v4/letter/m/9f8e36/32.png) [@Michael\_M](https://community.dynatrace.com/u/Michael_M)\
**Post date:** [July 7, 2025, 2:48pm UTC](https://community.dynatrace.com/t/containerized-activegate-change-memory-limits/52387/1 "2025-07-07T14:48:40Z")

</div>

Is it possible to change the memory limits of the AG in a containerized environment like it is descriped here for a non-containerized AG: [Configuration properties and parameters of ActiveGate — Dynatrace Docs](https://docs.dynatrace.com/docs/shortlink/sgw-configure#memory-limits)

The reason for my question is simpl: In the container the AG is alone and it still only uses 55% of max memory.  
From my point of view, this is not really a efficient use of the memory in the Pod.

I deploy the AG with the help of the Dynatrace Operator in our OpenShift environment.

---

<div class="post-metadata">

**Author:** ![DanielS](https://avatars.discourse-cdn.com/v4/letter/d/3ab097/32.png) [@DanielS](https://community.dynatrace.com/u/DanielS)\
**Post date:** [July 7, 2025, 5:29pm UTC](https://community.dynatrace.com/t/containerized-activegate-change-memory-limits/52387/2 "2025-07-07T17:29:23Z")

</div>

Yes, you can do it in the section activegate (Resource settings for ActiveGate container) of your Dynakube YAML :

```markup
apiVersion: dynatrace.com/v1beta4
kind: DynaKube
metadata:
  name: dynakube
  namespace: dynatrace
spec:
  # Link to api reference for further information: https://docs.dynatrace.com/docs/ingest-from/setup-on-k8s/reference/dynakube-parameters

  # Required: Dynatrace apiUrl including the `/api` path at the end.
  apiUrl: https://ENVIRONMENTID.live.dynatrace.com/api

  # Optional: Name of the secret holding the tokens used for connecting to Dynatrace.
  #
  # tokens: ""

  # Optional: Defines a custom pull secret in case you use a private registry when pulling images from the Dynatrace environment
  #
  # customPullSecret: "custom-pull-secret"

  # Optional: Disable certificate check for the connection between Dynatrace Operator and the Dynatrace Cluster.
  #
  # skipCertCheck: false

  # Optional: Set custom proxy settings either directly or from a secret with the field 'proxy'
  #
  # proxy:
  # value: my-proxy-url.com
  # valueFrom: name-of-my-proxy-secret

  # Optional: Add custom RootCAs from a configmap.
  #
  # trustedCAs: name-of-my-ca-configmap

  # Optional: Set a network zone for the OneAgent and ActiveGate pods.
  #
  # networkZone: name-of-my-network-zone

  # Optional: Configure istio to allow access to the Dynatrace Cluster from the OneAgent or ActiveGate pods.
  #
  # enableIstio: true

  # Optional: Minimum minutes between Dynatrace API requests.
  #
  # dynatraceApiRequestThreshold: 15

  # Configuration for Metadata Enrichment.
  #
  # metadataEnrichment:
  # enabled: true

    # Optional: The namespaces where you want Dynatrace Operator to inject
    #
    # namespaceSelector:
    # matchLabels:
    # app: my-app
    # matchExpressions:
    # - key: app
    # operator: In
    # values: [my-frontend, my-backend, my-database]

  # Configuration for Log monitoring.
  #
  # logMonitoring: {}

    # Optional: Specifies the rules and conditions for matching ingest attributes.
    #
    # ingestRuleMatchers:
    # - attribute: "k8s.namespace.name"
    # values:
    # - "kube-system"
    # - "dynatrace"
    # - "default"
    # - attribute: "k8s.pod.annotation",
    # values:
    # - "logs.dynatrace.com/ingest=true"
    # - "category=security"

  # Configuration for OneAgent
  #
  oneAgent:
    # Optional: Set a host group for OneAgent
    #
    # hostGroup: ""

    classicFullStack:
      # Optional: Specify the node selector that controls on which nodes OneAgent will be deployed.
      #
      # nodeSelector: {}

      # Optional: Assign a priority class to the OneAgent pods.
      #
      # priorityClassName: priority-class

      # Optional: Tolerations to include with the OneAgent DaemonSet.
      #
      tolerations:
        - effect: NoSchedule
          key: node-role.kubernetes.io/master
          operator: Exists
        - effect: NoSchedule
          key: node-role.kubernetes.io/control-plane
          operator: Exists

      # Optional: Resource settings for OneAgent container.
      #
      # oneAgentResources:
      # requests:
      # cpu: 100m
      # memory: 512Mi
      # limits:
      # cpu: 300m
      # memory: 1.5Gi

      # Optional: Set additional arguments to the OneAgent installer.
      #
      # args: []

      # Optional: Set additional environment variables for the OneAgent pods.
      #
      # env: []

      # Optional: Disable automatic restarts of OneAgent pods in case a new version is available
      #
      # autoUpdate: true

      # Optional: Set the DNS Policy for OneAgent pods.
      #
      # dnsPolicy: "ClusterFirstWithHostNet"

      # Optional: Add custom OneAgent annotations.
      #
      # annotations:
      # custom: annotation

      # Optional: Add custom labels to OneAgent pods
      #
      # labels:
      # custom: label

      # Optional: Use a custom OneAgent image.
      #
      # image: ""

      # Optional: The OneAgent version to be used.
      # Example: <major>.<minor>.<release>.<timestamp>, e.g. 1.200.0.20240101-000000
      #
      # version: ""

      # Optional: The SecComp Profile that will be configured in order to run in secure computing mode.
      #
      # secCompProfile: ""

  # Configuration for ActiveGate instances.
  #
  activeGate:
    # Defines the ActiveGate capabilities
    #
    capabilities:
      - routing
      - kubernetes-monitoring
      - dynatrace-api

    # Optional: Amount of replicas of ActiveGate pods.
    #
    # replicas: 1

    # Optional: Use a custom ActiveGate image
    #
    # image: ""

    # Optional: Set the ActiveGate group
    #
    # group: ""

    # Optional: Add a custom properties file by providing it as a value or by referencing it from a secret.
    #
    # customProperties:
    # value: |
    # [connectivity]
    # networkZone=
    # valueFrom: myCustomPropertiesSecret

    # Optional: Resource settings for ActiveGate container.
    #
    resources:
      requests:
        cpu: 500m
        memory: 1.5Gi
      limits:
        cpu: 1000m
        memory: 1.5Gi

    # Optional: Specify the node selector that controls on which nodes ActiveGate will be deployed.
    #
    # nodeSelector: {}

    # Optional: Set tolerations for the ActiveGate pods.
    #
    # tolerations:
    # - effect: NoSchedule
    # key: node-role.kubernetes.io/master
    # operator: Exists

    # Optional: Add custom labels to ActiveGate pods
    #
    # labels:
    # custom: label

    # Optional: Add custom environment variables to ActiveGate pods
    #
    # env: []

    # Optional: Name of a secret containing ActiveGate TLS certificate, key, and password.
    #
    # tlsSecretName: "my-tls-secret"

    # Optional: Set the DNS policy for ActiveGate pods.
    #
    # dnsPolicy: "Default"

    # Optional: Assign a priority class to the ActiveGate pods.
    #
    # priorityClassName: priority-class

    # Optional: Add custom annotations to ActiveGate pods
    #
    # annotations:
    # custom: annotation

    # Optional: Add TopologySpreadConstraints to the ActiveGate pods
    #
    # topologySpreadConstraints: []

```

---

<div class="post-metadata">

**Author:** ![Michael\_M](https://avatars.discourse-cdn.com/v4/letter/m/9f8e36/32.png) [@Michael\_M](https://community.dynatrace.com/u/Michael_M)\
**Post date:** [July 8, 2025, 7:38am UTC](https://community.dynatrace.com/t/containerized-activegate-change-memory-limits/52387/3 "2025-07-08T07:38:09Z")

</div>

Hi Daniel,

thanks for your suggestion but this is not exactly what I meant.

I was talking about how much memory of the assigned memory of the Pod the AG will use.  
For example: The pod has a limit and request of 3Gi but the AG will only use 50% of it.  
Log output of my AG  
Memory [maxMemory=1536M, initHeap=768M, maxHeap=1536M, usedMeta=7M, committedMeta=7M, totalPhysicalMemory=3072M, freePhysicalMemory=2988M]  
50% (-XX:MaxRAMPercentage=50) is the default for the AG and can be changed with the -java.xmx.relative\_part switch in the launcheruserconfig.conf.  
I understand that this is necessary for a non-containerized AG but in the container world I can spin up a container for each use case I have.  
The current use case is to monitor the OpenShift cluster with the kubernetes\_monitoring feature and my AG needs some memory for this. But unfortuneally because of this 50% default I have to define a relative high limit only to have use 50 % of the memory.

That why I would like to change this but I wasn’t able to finde a way with the operator. Not one I have found in the docs.

Regards

Michael

---

<div class="post-metadata">

**Author:** ![Romanenkov\_Al3x](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/romanenkov_al3x/32/36257_2.png) [@Romanenkov\_Al3x](https://community.dynatrace.com/u/Romanenkov_Al3x)\
**Post date:** [July 8, 2025, 4:53pm UTC](https://community.dynatrace.com/t/containerized-activegate-change-memory-limits/52387/4 "2025-07-08T16:53:53Z")

</div>

Hello&nbsp;[@Michael\_M](https://community.dynatrace.com/user/21221)

This thread for me is very interesting, bcs Dynatrace&nbsp;:dynatrace: + kubernetes&nbsp;&nbsp;❤️ I’ll do everything I can, whatever it takes.

There is two ways to do this:

**First** - If you prefer Kubernetes Hard Way (Joking&nbsp;😃) **Second -** GitOps is everything.&nbsp; (So true 😋)

**Results:** &nbsp;Memory [**maxMemory=5521M** , initHeap=3072M, maxHeap=5521M, usedMeta=14M, committedMeta=15M, totalPhysicalMemory=6144M, freePhysicalMemory=6031M] from your values&nbsp;&nbsp;[maxMemory\*\*=1536M\*\* …

 ![results](https://global.discourse-cdn.com/dynatrace/original/3X/5/d/5deb31e5a4000a40a6fba1436bcb108e8d34c7c1.png)

**1)**&nbsp;&nbsp;Only If you’re into challenges and spending fun evenings alone with the terminal.

If you have chance to update the StatefulSet and create several ConfigMaps, it’s not a big deal to get what you want.

Ideal if you don’t want change dynakube for some reasons.

You can create configmap:

```markup
apiVersion: v1
kind: ConfigMap
metadata:
  name: activegate-memory-config
  namespace: dynatrace
data:
  DT_INIT_HEAP_PERCENT: '50'
  DT_MAX_HEAP_PERCENT: '90'

```

Modify statefulSet + boost req/lim

```markup
...
      containers:
        - name: activegate
...
          env:
...            
           - name: DT_INIT_HEAP_PERCENT
              valueFrom:
                configMapKeyRef:
                  name: activegate-memory-config
                  key: DT_INIT_HEAP_PERCENT
            - name: DT_MAX_HEAP_PERCENT
              valueFrom:
                configMapKeyRef:
                  name: activegate-memory-config
                  key: DT_MAX_HEAP_PERCENT
...
            limits:
              cpu: '1'
              memory: 6Gi
            requests:
              cpu: 500m
              memory: 6Gi

```

2) As mentioned&nbsp;[@DanielS](https://community.dynatrace.com/user/35788)&nbsp;you can update dynakube.

You need to provide same env variables to container with name “activeagate”

You can define them here:

```markup
# Optional: Add custom environment variables to ActiveGate pods
    #
    # env: []

```

You need all the same environment variables from the first point.

DT\_INIT\_HEAP\_PERCENT: 50

DT\_MAX\_HEAP\_PERCENT: 90

Boost request/limits for example to 6Gi from 1.5Gi

Then the operator will work for you.

**Mischief managed.**

--

After this, you’ll probably want to tune something else — take a look at custom properties:

```markup
# customProperties:
    # value: |
    # [connectivity]
    # networkZone=

```

cat&nbsp;/var/lib/dynatrace/gateway/config/config.properties

Have fun!

Regards,

Aleksandr Romanenkov

---

<div class="post-metadata">

**Author:** ![Michael\_M](https://avatars.discourse-cdn.com/v4/letter/m/9f8e36/32.png) [@Michael\_M](https://community.dynatrace.com/u/Michael_M)\
**Post date:** [July 9, 2025, 7:49am UTC](https://community.dynatrace.com/t/containerized-activegate-change-memory-limits/52387/5 "2025-07-09T07:49:16Z")

</div>

Hi Aleksandr,

that was exactly what I was looking for.

I set the environment variables in my dynakube an the activegate use the memory how I want it to use.

One question: I couldn’t find this env variables in the documentation. Where did you get them?

Regards

Michael

---

<div class="post-metadata">

**Author:** ![Romanenkov\_Al3x](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/romanenkov_al3x/32/36257_2.png) [@Romanenkov\_Al3x](https://community.dynatrace.com/u/Romanenkov_Al3x)\
**Post date:** [July 9, 2025, 8:32am UTC](https://community.dynatrace.com/t/containerized-activegate-change-memory-limits/52387/6 "2025-07-09T08:32:19Z")

</div>

Hey Michael, great to hear it worked out.

Honestly, it’s not that hard — you can get that info too. This is not a secret in Vault (haha​😄).

All you have to do is know the container’s entrypoint, check out the script (the sh that launches the gateway), and the parameters are right there.

Regards,

Aleksandr Romanenkov

---

<div class="post-metadata">

**Author:** ![Michael\_M](https://avatars.discourse-cdn.com/v4/letter/m/9f8e36/32.png) [@Michael\_M](https://community.dynatrace.com/u/Michael_M)\
**Post date:** [July 9, 2025, 9:34am UTC](https://community.dynatrace.com/t/containerized-activegate-change-memory-limits/52387/7 "2025-07-09T09:34:41Z")

</div>

THX for the info, I will do that&nbsp;😉

---

<div class="post-metadata">

**Author:** ![mizso74](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/mizso74/32/41729_2.png) [@mizso74](https://community.dynatrace.com/u/mizso74)\
**Post date:** [June 29, 2026, 4:44pm UTC](https://community.dynatrace.com/t/containerized-activegate-change-memory-limits/52387/8 "2026-06-29T16:44:43Z")

</div>

Hi&nbsp;[@Romanenkov\_Al3x](https://community.dynatrace.com/user/51881),

Thanks for share it. ConfigMap is good idea…

Have you faced any issue with the&nbsp;DT\_MAX\_HEAP\_PERCENT: 90 at any avtivegates?

Where did you find this parameter in the official documentation? or have you found it in the github?

Thanks.

Best regards,

János
