# Change JVM Heap Size with Logstash Helm Chart

**URL:** https://discuss.elastic.co/t/change-jvm-heap-size-with-logstash-helm-chart/149736
**Category:** Logstash
**Created:** [September 24, 2018, 8:42pm UTC](https://discuss.elastic.co/t/change-jvm-heap-size-with-logstash-helm-chart/149736 "2018-09-24T20:42:57Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![chenchik](https://avatars.discourse-cdn.com/v4/letter/c/ac91a4/32.png) [@chenchik](https://discuss.elastic.co/u/chenchik)
#### Post date: [September 24, 2018, 8:42pm UTC](https://discuss.elastic.co/t/change-jvm-heap-size-with-logstash-helm-chart/149736/1 "2018-09-24T20:42:58Z")

</div>

I'm currently using the Logstash Kubernetes Helm chart, linked below:

> **[helm/charts](https://github.com/helm/charts/tree/master/incubator/logstash)**
>
> Curated applications for Kubernetes. Contribute to helm/charts development by creating an account on GitHub.

There doesn't seem to be a way to increase the JVM heap size using the values.yaml file.

I have also tried setting the environment variable `LS_JAVA_OPTS` as a parameter in the initial start up of the container by setting it's value to be `LS_JAVA_OPTS="-Xmx4g -Xms2g"`. I have been able to confirm that this environment variable is set by running `echo $LS_JAVA_OPTS`. Its values are not used in the start up of the of the JVM, reflected with this command:

```auto
bash-4.2$ ps -aux
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
logstash 1 191 4.2 6844236 661540 ? Ssl 20:31 1:11 /bin/java -Xms1g -Xmx1g -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -Djava.awt.headless=true -

```

I can't manually edit the file /usr/share/logstash/config/jvm.options because I need to be able to run logstash on start up of the container. Is there any other way to change the JVM Heap size option?

---

<div class="post-metadata">

### Author: ![yaauie](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yaauie/32/23363_2.png) [@yaauie](https://discuss.elastic.co/u/yaauie)
#### Post date: [September 24, 2018, 9:49pm UTC](https://discuss.elastic.co/t/change-jvm-heap-size-with-logstash-helm-chart/149736/2 "2018-09-24T21:49:22Z")

</div>

Although the `LS_JAVA_OPTS` environment variable is set, is it _exported_ from your shell to sub-shells?

Test with:

```auto
export | grep LS_JAVA_OPTS

```

If it doesn't show up there, you'll need to export it:

```auto
export LS_JAVA_OPTS

```

---

<div class="post-metadata">

### Author: ![chenchik](https://avatars.discourse-cdn.com/v4/letter/c/ac91a4/32.png) [@chenchik](https://discuss.elastic.co/u/chenchik)
#### Post date: [September 24, 2018, 10:02pm UTC](https://discuss.elastic.co/t/change-jvm-heap-size-with-logstash-helm-chart/149736/3 "2018-09-24T22:02:43Z")

</div>

This is my output when I run the first command:

```auto
sh-4.2$ export | grep LS_JAVA_OPTS
export LS_JAVA_OPTS="-Xmx4g -Xms2g"

```

The way that I'm setting the environment variable is by using a values file that overrides the upstream helm chart. This is what I have in my values file.

```auto
  config:
    ls.java.opts: "-Xmx4g -Xms2g"
  resources:
    limits:
      memory: 8Gi
    requests: 
      memory: 8Gi
  replicaCount: 2

```

So this environment variable gets created on creation of the container itself.

---

<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: [October 22, 2018, 10:02pm UTC](https://discuss.elastic.co/t/change-jvm-heap-size-with-logstash-helm-chart/149736/4 "2018-10-22T22:02:45Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
