# Logstash container cant read jvm.options correctly

**URL:** https://discuss.elastic.co/t/logstash-container-cant-read-jvm-options-correctly/120255
**Category:** Logstash
**Created:** [February 16, 2018, 8:59pm UTC](https://discuss.elastic.co/t/logstash-container-cant-read-jvm-options-correctly/120255 "2018-02-16T20:59:23Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![red888](https://avatars.discourse-cdn.com/v4/letter/r/ecae2f/32.png) [@red888](https://discuss.elastic.co/u/red888)
#### Post date: [February 16, 2018, 8:59pm UTC](https://discuss.elastic.co/t/logstash-container-cant-read-jvm-options-correctly/120255/1 "2018-02-16T20:59:23Z")

</div>

here is my dockerfile:

```
FROM docker.elastic.co/logstash/logstash:6.2.1

SHELL ["/bin/bash", "-c"]

COPY ./jvm.options /etc/logstash/jvm.options

```

Copied my jvm options right from [https://github.com/elastic/logstash/blob/master/config/jvm.options](https://github.com/elastic/logstash/blob/master/config/jvm.options)

First thing I get is `Invalid initial heap size: -Xms1g` and my docker service is allocated 2.5 gigs, so should have enough.

THen I comment out the memory settings and get a new error:  
'nrecognized VM option 'UseParNewGC  
Did you mean '(+/-)UseParNewGC'?

Is this even supposed to work? Your docs are broken too: [https://www.elastic.co/guide/en/logstash/current/\_configuring\_logstash\_for\_docker.html](https://www.elastic.co/guide/en/logstash/current/_configuring_logstash_for_docker.html)

---

<div class="post-metadata">

### Author: ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)
#### Post date: [February 16, 2018, 9:05pm UTC](https://discuss.elastic.co/t/logstash-container-cant-read-jvm-options-correctly/120255/2 "2018-02-16T21:05:56Z")

</div>

What does "java -version" produce?

---

<div class="post-metadata">

### Author: ![red888](https://avatars.discourse-cdn.com/v4/letter/r/ecae2f/32.png) [@red888](https://discuss.elastic.co/u/red888)
#### Post date: [February 16, 2018, 9:09pm UTC](https://discuss.elastic.co/t/logstash-container-cant-read-jvm-options-correctly/120255/3 "2018-02-16T21:09:19Z")

</div>

Inside the container?  
If i add `RUN java -version` I see this:

```
openjdk version "1.8.0_161"

OpenJDK Runtime Environment (build 1.8.0_161-b14)

OpenJDK 64-Bit Server VM (build 25.161-b14, mixed mode)
```

---

<div class="post-metadata">

### Author: ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)
#### Post date: [February 16, 2018, 9:17pm UTC](https://discuss.elastic.co/t/logstash-container-cant-read-jvm-options-correctly/120255/4 "2018-02-16T21:17:34Z")

</div>

The jvm.options assume a HotSpot JVM. They will not work as-is for OpenJDK (or J9 or any other JVM). So for example, HotSpot allows a heap size of 2g, whereas OpenJDK appears to expect 2048m instead.

You would have to go through the man page for the JVM to work out the equivalent of the HotSpot options you are setting.

---

<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: [March 16, 2018, 9:18pm UTC](https://discuss.elastic.co/t/logstash-container-cant-read-jvm-options-correctly/120255/5 "2018-03-16T21:18:10Z")

</div>

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