# Insufficient memory to run logstash-keystore

**URL:** <https://discuss.elastic.co/t/insufficient-memory-to-run-logstash-keystore/304734>\
**Category:** Logstash\
**Created:** [May 14, 2022, 5:01pm UTC](https://discuss.elastic.co/t/insufficient-memory-to-run-logstash-keystore/304734 "2022-05-14T17:01:35Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mcosta](https://avatars.discourse-cdn.com/v4/letter/m/6a8cbe/32.png) [@mcosta](https://discuss.elastic.co/u/mcosta)\
**Post date:** [May 14, 2022, 5:01pm UTC](https://discuss.elastic.co/t/insufficient-memory-to-run-logstash-keystore/304734/1 "2022-05-14T17:01:35Z")

</div>

Hi all,

Running logstash 7.17.3 on a 8 GB RHEL 8.5 with -Xms4g -Xmx4g.

Until now I was able to run "bin/logstash-keystore --path.settings ${LOGSTASH\_CONF} list" command but now I get the following error:

```auto
OpenJDK 64-Bit Server VM warning: INFO: os::commit_memory(0x000000070a660000, 4120510464, 0) failed; error='Not enough space' (errno=12)
#
# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (mmap) failed to map 4120510464 bytes for committing reserved memory.
# An error report file with more information is saved as:
# /usr/share/logstash/hs_err_pid1058879.log

```

Is there anyone with the same problem on version 7.17.3?

I upgrade logstash from 7.17.1 to 7.17.3 on both QA and Production (about a week between QA and Prod) and now both have same memory problem.

Thank you.  
MC

---

<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:** [May 14, 2022, 6:33pm UTC](https://discuss.elastic.co/t/insufficient-memory-to-run-logstash-keystore/304734/2 "2022-05-14T18:33:04Z")

</div>

> [@mcosta](#):
>
> `failed to map 4120510464`

It is trying to allocate 4GB of memory. If you have 8 GB of memory and a logstash instance is already using 4 GB of it you will not be able to allocate 4 GB.

Reduce -Xms4g.

---

<div class="post-metadata">

**Author:** ![mcosta](https://avatars.discourse-cdn.com/v4/letter/m/6a8cbe/32.png) [@mcosta](https://discuss.elastic.co/u/mcosta)\
**Post date:** [May 14, 2022, 10:16pm UTC](https://discuss.elastic.co/t/insufficient-memory-to-run-logstash-keystore/304734/3 "2022-05-14T22:16:17Z")

</div>

Thank you for your reply.

Yes, I know I can configure a smaller value but Logstash it's configured with -Xms4g -Xmx4g since deployed long time ago and I always was able to use logstash-keystore utility.

Besides, official recomendations is:

- The recommended heap size for typical ingestion scenarios should be no less than 4GB and no more than 8GB.

- Set the minimum (Xms) and maximum (Xmx) heap allocation size to the same value to prevent the heap from resizing at runtime, which is a very costly process.

I suspect that something related to memory allocation by logstash-keystore changed on 7.17.X release.

Can someone reproduce the issue?

Thanks

---

<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:** [June 11, 2022, 10:17pm UTC](https://discuss.elastic.co/t/insufficient-memory-to-run-logstash-keystore/304734/4 "2022-06-11T22:17:05Z")

</div>

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