# Try using the -Djava.io.tmpdir= option to select an alternate temp location

**URL:** <https://discuss.elastic.co/t/try-using-the-djava-io-tmpdir-option-to-select-an-alternate-temp-location/111013>\
**Category:** Elasticsearch\
**Created:** [December 11, 2017, 6:30am UTC](https://discuss.elastic.co/t/try-using-the-djava-io-tmpdir-option-to-select-an-alternate-temp-location/111013 "2017-12-11T06:30:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mathias](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mathias/32/23176_2.png) [@mathias](https://discuss.elastic.co/u/mathias)\
**Post date:** [December 11, 2017, 6:30am UTC](https://discuss.elastic.co/t/try-using-the-djava-io-tmpdir-option-to-select-an-alternate-temp-location/111013/1 "2017-12-11T06:30:22Z")

</div>

Hi,

I notice some of my elasticsearch containers do cyclic restarts after long service.  
docker logs show the following:  
Version:1.0 StartHTML:0000000105 EndHTML:0000039235 StartFragment:0000037910 EndFragment:0000039195

```
OpenJDK 64-Bit Server VM warning: Insufficient space for shared memory file:

   19

Try using the -Djava.io.tmpdir= option to select an alternate temp location.

OpenJDK 64-Bit Server VM warning: Insufficient space for shared memory file:

   1

Try using the -Djava.io.tmpdir= option to select an alternate temp location.

```

After this I have disabled java performance monitoring and changed location of tmp dir but I still see that hsperfdata directories are created under systems tmp directory.

```
bash-4.3# tree /tmp
/tmp
├── hsperfdata_elasticsearch
└── hsperfdata_root

2 directories, 0 files

```

One directory is created in new tmp dir:

> bash-4.3# tree /elasticsearch/tmp/  
> /elasticsearch/tmp/  
> └── jna--1985354563

java is started with right options I believe:

> bash-4.3# ps aux | grep java  
> 1 elastics 2:10 /usr/lib/jvm/java-1.8-openjdk/jre/bin/java -Xms6g -Xmx6g -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -XX:+DisableExplicitGC -XX:+AlwaysPreTouch -server -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djna.nosys=true -Dio.netty.noUnsafe=true -Dio.netty.noKeySetOptimization=true -Dlog4j.shutdownHookEnabled=false -Dlog4j2.disable.jmx=true -Dlog4j.skipJansi=true -XX:+HeapDumpOnOutOfMemoryError -XX:-UsePerfData -Djava.io.tmpdir=/elasticsearch/tmp -Des.path.home=/usr/share/elasticsearch -cp /usr/share/elasticsearch/lib/\* org.elasticsearch.bootstrap.Elasticsearch

Are there anything I can do about the hsperf directories under /tmp?

Kinds Regards  
Mathias

---

<div class="post-metadata">

**Author:** ![s1monw](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/s1monw/32/3637_2.png) [@s1monw](https://discuss.elastic.co/u/s1monw)\
**Post date:** [December 15, 2017, 10:50am UTC](https://discuss.elastic.co/t/try-using-the-djava-io-tmpdir-option-to-select-an-alternate-temp-location/111013/2 "2017-12-15T10:50:15Z")

</div>

hey mathias,

I wonder if this post can help [Is hsperfdata file critical?](https://discuss.elastic.co/t/is-hsperfdata-file-critical/44586/3)

---

<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:** [January 12, 2018, 10:50am UTC](https://discuss.elastic.co/t/try-using-the-djava-io-tmpdir-option-to-select-an-alternate-temp-location/111013/3 "2018-01-12T10:50:45Z")

</div>

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