# Preferred method of setting JVM options for process memory

**URL:** <https://discuss.elastic.co/t/preferred-method-of-setting-jvm-options-for-process-memory/217378>\
**Category:** Elasticsearch\
**Created:** [January 31, 2020, 1:29pm UTC](https://discuss.elastic.co/t/preferred-method-of-setting-jvm-options-for-process-memory/217378 "2020-01-31T13:29:13Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![TheVintik](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/thevintik/32/60494_2.png) [@TheVintik](https://discuss.elastic.co/u/TheVintik)\
**Post date:** [January 31, 2020, 1:29pm UTC](https://discuss.elastic.co/t/preferred-method-of-setting-jvm-options-for-process-memory/217378/1 "2020-01-31T13:29:13Z")

</div>

Hello,  
I have a question about memory for ElasticSearch. I am using 7x version, and I was setup my OS (centos 7 / 32 GB RAM) with the following configs (ES\_JAVA\_OPTS="-Xms16g -Xmx16g"):

> <https://stackoverflow.com/questions/45008355/elasticsearch-process-memory-locking-failed/50200076#50200076>

When I restarted my ES service I got the following system info:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/8/2/82327782e73e9088fc28ca120c51b3a9742ee807.png)

So, 16 GB of 32 GB was reserved, as I understand, for ES.

But, I still saw, that ES processes (threads?) were still used 1GB of RAM:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/6/2/62c53420679841b562816dfdb51aae51049cad22.png)

Is this OK or not?

I did another change, described here: [https://www.elastic.co/guide/en/elasticsearch/reference/current/jvm-options.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/jvm-options.html) and updated  
/etc/elasticsearch/jvm.options with

```auto
-Xms16g
-Xmx16g

```

After that I got:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/f/3/f322e2b8cd96cc9191fe59e92c410714c1d98e18.png)

So, my question is - should I see 16Gb per ES process or ES already was started with 16Gb limitation and created a lot of threads with 1Gb?

---

<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:** [February 28, 2020, 1:29pm UTC](https://discuss.elastic.co/t/preferred-method-of-setting-jvm-options-for-process-memory/217378/2 "2020-02-28T13:29:17Z")

</div>

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