# Elastic JVM heap file dumps deletion

**URL:** https://discuss.elastic.co/t/elastic-jvm-heap-file-dumps-deletion/135409
**Category:** Elasticsearch
**Created:** [June 11, 2018, 5:24pm UTC](https://discuss.elastic.co/t/elastic-jvm-heap-file-dumps-deletion/135409 "2018-06-11T17:24:54Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Amandeep\_Singh1](https://avatars.discourse-cdn.com/v4/letter/a/6f9a4e/32.png) [@Amandeep\_Singh1](https://discuss.elastic.co/u/Amandeep_Singh1)
#### Post date: [June 11, 2018, 5:24pm UTC](https://discuss.elastic.co/t/elastic-jvm-heap-file-dumps-deletion/135409/1 "2018-06-11T17:24:54Z")

</div>

Elasticsearch ships withs -XX:+HeapDumpOnOutOfMemory enabled, this leads to the heap dumps being generated whenever the JVM encounters an OutOfMemoryError.

These generate hprof files in with default location as /var/lib/elasticsearch/ the question i have is how to safely delete these files without affecting the system(running elasticsearch instance).

---

<div class="post-metadata">

### Author: ![danielmitterdorfer](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/danielmitterdorfer/32/110510_2.png) [@danielmitterdorfer](https://discuss.elastic.co/u/danielmitterdorfer)
#### Post date: [June 15, 2018, 9:43am UTC](https://discuss.elastic.co/t/elastic-jvm-heap-file-dumps-deletion/135409/2 "2018-06-15T09:43:46Z")

</div>

Hi,

Elasticsearch does not open them so you can just delete heap dumps like any other file with `rm` on the command line.

Heap dumps are often useful to understand why the application ran out of memory. I'd advise against it but if you are a 100% certain that you don't want them you can disable it explicitly by setting `-XX:-HeapDumpOnOutOfMemory` instead.

Daniel

---

<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 13, 2018, 9:53am UTC](https://discuss.elastic.co/t/elastic-jvm-heap-file-dumps-deletion/135409/3 "2018-07-13T09:53:13Z")

</div>

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