# Field data cache and JVM old memory

**URL:** https://discuss.elastic.co/t/field-data-cache-and-jvm-old-memory/75273
**Category:** Elasticsearch
**Created:** [February 16, 2017, 4:36am UTC](https://discuss.elastic.co/t/field-data-cache-and-jvm-old-memory/75273 "2017-02-16T04:36:58Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![BrickXu](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/brickxu/32/15462_2.png) [@BrickXu](https://discuss.elastic.co/u/BrickXu)
#### Post date: [February 16, 2017, 4:36am UTC](https://discuss.elastic.co/t/field-data-cache-and-jvm-old-memory/75273/1 "2017-02-16T04:36:58Z")

</div>

Hi guys,

My question is that whether the field data cache is always in the JVM old memory or not ?

The configuration of the field data cache told that it is based on the heap memory but not the old memory, But in my cluster, A hurge agg query maybe let the JVM become a FullGC for a long time and the old memory grows bigger.

Should I set the field data cache based on the old memory size ?

Thanks,  
BR

---

<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: [February 17, 2017, 8:35am UTC](https://discuss.elastic.co/t/field-data-cache-and-jvm-old-memory/75273/2 "2017-02-17T08:35:40Z")

</div>

Hi @BrickXu,

the JVM decides in which part of the heap (young or old generation) it places an object and this also changes over time (most objects are allocated in the young generation and move to the old generation eventually if they survive enough garbage collection cycles). For the field data cache it is almost certain that it ends up in the old generation of the heap.

I assume by "configuration of the field data cache" you mean the setting `indices.breaker.fielddata.limit` of the [field data circuit breaker](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/circuit-breaker.html#fielddata-circuit-breaker). You should define this setting based on how much heap you have available in total and independent of how large individual generations of the heap are. You should also not let your heap grow dynamically but instead predefine minimum and maximum heap size in `config/jvm.options` (I'm assuming Elasticsearch 5 or better).

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: [March 17, 2017, 8:35am UTC](https://discuss.elastic.co/t/field-data-cache-and-jvm-old-memory/75273/3 "2017-03-17T08:35:51Z")

</div>

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