# ES6.1 Heap memory used by the index writer

**URL:** <https://discuss.elastic.co/t/es6-1-heap-memory-used-by-the-index-writer/116535>\
**Category:** Elasticsearch\
**Created:** [January 22, 2018, 9:02pm UTC](https://discuss.elastic.co/t/es6-1-heap-memory-used-by-the-index-writer/116535 "2018-01-22T21:02:46Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![loren](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/loren/32/44942_2.png) [@loren](https://discuss.elastic.co/u/loren)\
**Post date:** [February 2, 2018, 8:24pm UTC](https://discuss.elastic.co/t/es6-1-heap-memory-used-by-the-index-writer/116535/6 "2018-02-02T20:24:35Z")

</div>

Might also be relevant to add that this problem index gets a lot of updates, and the updates happen via a Painless script:

```auto
{
  "script": {
    "source": "ctx._source.child_ids.add(params.child_id)",
    "params": {
      "child_id": 1234
    }
  }
}

```

It's maintaining an array that has an average length of 3 but a maximum length of 100,000.

Perhaps if all 100,000 of those Painless updates happened to a given document in series it would place an unusual stress on the shard?

Reading @nik9000's [post](https://discuss.elastic.co/t/groovy-vs-painless-performance-difference/82886/6?u=loren) about how Lucene handles `_source` has me wondering.

---

_[View the full topic](https://discuss.elastic.co/t/es6-1-heap-memory-used-by-the-index-writer/116535)._
