# Need memory management help

**URL:** <https://discuss.elastic.co/t/need-memory-management-help/5470>\
**Category:** Elasticsearch\
**Created:** [September 28, 2011, 2:09pm UTC](https://discuss.elastic.co/t/need-memory-management-help/5470 "2011-09-28T14:09:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![M\_C](https://avatars.discourse-cdn.com/v4/letter/m/96bed5/32.png) [@M\_C](https://discuss.elastic.co/u/M_C)\
**Post date:** [September 28, 2011, 2:09pm UTC](https://discuss.elastic.co/t/need-memory-management-help/5470/1 "2011-09-28T14:09:09Z")

</div>

I'm running elastic search with the elasticsearch service wrapper.

It is running with the following commandline:

Service:

/usr/local/elasticsearch/bin/service/exec/elasticsearch-linux-x86-64 /  
usr/local/elasticsearch/bin/service/elasticsearch.conf  
wrapper.syslog.ident=elasticsearch wrapper.pidfile=/usr/local/  
elasticsearch/bin/service/./elasticsearch.pid  
wrapper.name=elasticsearch wrapper.displayname=ElasticSearch  
wrapper.daemonize=TRUE wrapper.statusfile=/usr/local/elasticsearch/bin/  
service/./elasticsearch.status wrapper.java.statusfile=/usr/local/  
elasticsearch/bin/service/./elasticsearch.java.status

Java app:

java -Delasticsearch-service -Des-foreground=yes -Des.path.home=/usr/  
local/elastisearch -Djline.enabled=true -XX:+UseParNewGC -XX:  
+UseConcMarkSweepGC -XX:+CMSParallelRemarkEnabled -XX:SurvivorRatio=8 -  
XX:MaxTenuringThreshold=1 -XX:CMSInitiatingOccupancyFraction=75 -XX:  
+UseCMSInitiatingOccupancyOnly -XX:+HeapDumpOnOutOfMemoryError -  
Xms128m -Xmx128m -Djava.library.path=/usr/local/elasticsearch/bin/  
service/lib -classpath /usr/local/elastisearch/bin/service/lib/  
wrapper.jar:/usr/local/elasticsearch/lib/elasticsearch-0.16.2.jar:/usr/  
local/elasticsearch/lib/jline-0.9.94.jar:/usr/local/elasticsearch/lib/  
jna-3.2.7.jar:/usr/local/elasticsearch/lib/log4j-1.2.15.jar:/usr/local/  
elasticsearch/lib/lucene-analyzers-3.1.0.jar:/usr/local/elasticsearch/  
lib/lucene-core-3.1.0.jar:/usr/local/elasticsearch/lib/lucene-  
highlighter-3.1.0.jar:/usr/local/elasticsearch/lib/lucene-  
memory-3.1.0.jar:/usr/local/elasticsearch/lib/lucene-  
queries-3.1.0.jar:/usr/local/elasticsearch/lib/sigar/sigar-1.6.4.jar -  
Dwrapper.key=\_W0gBuF6pmW0y2lL -Dwrapper.port=32000 -  
Dwrapper.jvm.port.min=31000 -Dwrapper.jvm.port.max=31999 -  
Dwrapper.disable\_console\_input=TRUE -Dwrapper.pid=32072 -  
Dwrapper.version=3.5.6 -Dwrapper.native\_library=wrapper -  
Dwrapper.service=TRUE -Dwrapper.cpu.timeout=10 -Dwrapper.jvmid=1  
org.tanukisoftware.wrapper.WrapperSimpleApp  
org.elasticsearch.bootstrap.Bootstrap

However it is consuming 500 MB of reserved memory and 1GB of virtual  
memory. As you can see the heap sizes are set to 128m (min and max).  
I've tried to enable jconsole on the app by adding -  
Dcom.sun.management.jmxremote to the commandline and that has no  
effect either. Is the jvm somehow ignoring all these options? I'm  
very confused not just because it is not acting how I want it to but  
because my changes seem to have no effect on the app at all. If i  
raise the memory to 2GB the size doesn't change either.

I really need help with this if anyone has any to offer.

Thanks

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [October 2, 2011, 8:03am UTC](https://discuss.elastic.co/t/need-memory-management-help/5470/2 "2011-10-02T08:03:24Z")

</div>

When you set Xms and Xmx, it affects the _heap_ memory of the JVM, not all  
the memory used by the process.

You can use the node info and stats API to see how its configured (info),  
and current values (stats).

On Wed, Sep 28, 2011 at 5:09 PM, M C [mcaddr@gmail.com](mailto:mcaddr@gmail.com) wrote:

> I'm running Elasticsearch with the elasticsearch service wrapper.
> 
> It is running with the following commandline:
> 
> Service:
> 
> /usr/local/elasticsearch/bin/service/exec/elasticsearch-linux-x86-64 /  
> usr/local/elasticsearch/bin/service/elasticsearch.conf  
> wrapper.syslog.ident=elasticsearch wrapper.pidfile=/usr/local/  
> elasticsearch/bin/service/./elasticsearch.pid  
> wrapper.name=elasticsearch wrapper.displayname=Elasticsearch  
> wrapper.daemonize=TRUE wrapper.statusfile=/usr/local/elasticsearch/bin/  
> service/./elasticsearch.status wrapper.java.statusfile=/usr/local/  
> elasticsearch/bin/service/./elasticsearch.java.status
> 
> Java app:
> 
> java -Delasticsearch-service -Des-foreground=yes -Des.path.home=/usr/  
> local/elastisearch -Djline.enabled=true -XX:+UseParNewGC -XX:  
> +UseConcMarkSweepGC -XX:+CMSParallelRemarkEnabled -XX:SurvivorRatio=8 -  
> XX:MaxTenuringThreshold=1 -XX:CMSInitiatingOccupancyFraction=75 -XX:  
> +UseCMSInitiatingOccupancyOnly -XX:+HeapDumpOnOutOfMemoryError -  
> Xms128m -Xmx128m -Djava.library.path=/usr/local/elasticsearch/bin/  
> service/lib -classpath /usr/local/elastisearch/bin/service/lib/  
> wrapper.jar:/usr/local/elasticsearch/lib/elasticsearch-0.16.2.jar:/usr/  
> local/elasticsearch/lib/jline-0.9.94.jar:/usr/local/elasticsearch/lib/  
> jna-3.2.7.jar:/usr/local/elasticsearch/lib/log4j-1.2.15.jar:/usr/local/  
> elasticsearch/lib/lucene-analyzers-3.1.0.jar:/usr/local/elasticsearch/  
> lib/lucene-core-3.1.0.jar:/usr/local/elasticsearch/lib/lucene-  
> highlighter-3.1.0.jar:/usr/local/elasticsearch/lib/lucene-  
> memory-3.1.0.jar:/usr/local/elasticsearch/lib/lucene-  
> queries-3.1.0.jar:/usr/local/elasticsearch/lib/sigar/sigar-1.6.4.jar -  
> Dwrapper.key=\_W0gBuF6pmW0y2lL -Dwrapper.port=32000 -  
> Dwrapper.jvm.port.min=31000 -Dwrapper.jvm.port.max=31999 -  
> Dwrapper.disable\_console\_input=TRUE -Dwrapper.pid=32072 -  
> Dwrapper.version=3.5.6 -Dwrapper.native\_library=wrapper -  
> Dwrapper.service=TRUE -Dwrapper.cpu.timeout=10 -Dwrapper.jvmid=1  
> org.tanukisoftware.wrapper.WrapperSimpleApp  
> org.elasticsearch.bootstrap.Bootstrap
> 
> However it is consuming 500 MB of reserved memory and 1GB of virtual  
> memory. As you can see the heap sizes are set to 128m (min and max).  
> I've tried to enable jconsole on the app by adding -  
> Dcom.sun.management.jmxremote to the commandline and that has no  
> effect either. Is the jvm somehow ignoring all these options? I'm  
> very confused not just because it is not acting how I want it to but  
> because my changes seem to have no effect on the app at all. If i  
> raise the memory to 2GB the size doesn't change either.
> 
> I really need help with this if anyone has any to offer.
> 
> 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:** [July 6, 2017, 3:53am UTC](https://discuss.elastic.co/t/need-memory-management-help/5470/3 "2017-07-06T03:53:10Z")

</div>


