# Settings Xmx via stetefulSets does not increase pod memory even after re-creating pod

**URL:** <https://discuss.elastic.co/t/settings-xmx-via-stetefulsets-does-not-increase-pod-memory-even-after-re-creating-pod/226083>\
**Category:** Elastic Cloud on Kubernetes (ECK)\
**Created:** [April 1, 2020, 3:58pm UTC](https://discuss.elastic.co/t/settings-xmx-via-stetefulsets-does-not-increase-pod-memory-even-after-re-creating-pod/226083 "2020-04-01T15:58:43Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![scarby](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/scarby/32/61788_2.png) [@scarby](https://discuss.elastic.co/u/scarby)\
**Post date:** [April 1, 2020, 3:58pm UTC](https://discuss.elastic.co/t/settings-xmx-via-stetefulsets-does-not-increase-pod-memory-even-after-re-creating-pod/226083/1 "2020-04-01T15:58:44Z")

</div>

i have the following elastic-search deployment described:

```auto
apiVersion: elasticsearch.k8s.elastic.co/v1
kind: Elasticsearch
metadata:
  annotations:
    common.k8s.elastic.co/controller-version: 1.0.0
    elasticsearch.k8s.elastic.co/cluster-uuid: 1gZHNvZSSwK_0jP7QrFJpg
  creationTimestamp: "2020-01-30T04:21:35Z"
  generation: 6
  name: logs
  namespace: logs
  resourceVersion: "33407416"
  selfLink: /apis/elasticsearch.k8s.elastic.co/v1/namespaces/logs/elasticsearches/logs
  uid: d346d27a-1717-4627-b34a-2aaf86de020f
spec:
  http:
    service:
      metadata:
        creationTimestamp: null
      spec:
        type: LoadBalancer
    tls:
      certificate:
        secretName: magneto-tls
  nodeSets:
  - config:
      node.data: true
      node.ingest: true
      node.master: true
      node.store.allow_mmap: true
    count: 3
    name: default
    podTemplate:
      metadata:
        creationTimestamp: null
      spec:
        containers:
        - env:
          - name: ES_JAVA_OPTS
            value: -Xms4g -Xmx4g
          name: elasticsearch
          resources:
            requests:
              memory: 8Gi
    volumeClaimTemplates:
    - metadata:
        creationTimestamp: null
        name: elasticsearch-data
        namespace: logs
      spec:
        accessModes:
        - ReadWriteOnce
        resources:
          requests:
            storage: 100Gi
        storageClassName: gce-ssd
      status: {}
  updateStrategy:
    changeBudget: {}
  version: 7.5.0

```

Initially this started off with using the default settings for java options. However our deployment began to fall over due to the default memory settings simply not being enough. As such the ES\_JAVA\_OPTIONS flag was added, unfortunately this has not changed anything, even forcing deletion and re-creation of the pod does not lead to the increase in Xmx or Xmx on the container.

```auto
usr/share/elasticsearch/jdk/bin/java -Des.networkaddress.cache.ttl=60 -Des.networkaddress.cache.negative.ttl=10 -XX:+AlwaysPreTouch -Xss1m -Djava.awt.headless=true -Dfile.encoding=UTF

```

is still used for java options.

I'm not sure i'm doing something wrong here or if this is a bug?

---

<div class="post-metadata">

**Author:** ![scarby](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/scarby/32/61788_2.png) [@scarby](https://discuss.elastic.co/u/scarby)\
**Post date:** [April 1, 2020, 11:50pm UTC](https://discuss.elastic.co/t/settings-xmx-via-stetefulsets-does-not-increase-pod-memory-even-after-re-creating-pod/226083/3 "2020-04-01T23:50:52Z")

</div>

in fact - nothing i change here seems to alter the statefulSet post deployment. Raising in github repo

---

<div class="post-metadata">

**Author:** ![sebgl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sebgl/32/48702_2.png) [@sebgl](https://discuss.elastic.co/u/sebgl)\
**Post date:** [April 2, 2020, 12:27pm UTC](https://discuss.elastic.co/t/settings-xmx-via-stetefulsets-does-not-increase-pod-memory-even-after-re-creating-pod/226083/4 "2020-04-02T12:27:18Z")

</div>

I answered in the github issue: [https://github.com/elastic/cloud-on-k8s/issues/2804](https://github.com/elastic/cloud-on-k8s/issues/2804).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [November 4, 2022, 7:51am UTC](https://discuss.elastic.co/t/settings-xmx-via-stetefulsets-does-not-increase-pod-memory-even-after-re-creating-pod/226083/5 "2022-11-04T07:51:49Z")

</div>


