# Template migration from parent-child to nested give java heap memory issue

**URL:** <https://discuss.elastic.co/t/template-migration-from-parent-child-to-nested-give-java-heap-memory-issue/360147>\
**Category:** Elasticsearch\
**Created:** [May 24, 2024, 10:45am UTC](https://discuss.elastic.co/t/template-migration-from-parent-child-to-nested-give-java-heap-memory-issue/360147 "2024-05-24T10:45:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![swappy](https://avatars.discourse-cdn.com/v4/letter/s/a5b964/32.png) [@swappy](https://discuss.elastic.co/u/swappy)\
**Post date:** [May 24, 2024, 10:45am UTC](https://discuss.elastic.co/t/template-migration-from-parent-child-to-nested-give-java-heap-memory-issue/360147/1 "2024-05-24T10:45:25Z")

</div>

Hello,  
We are in a process of upgrading our elasticsearch version and for that we decided to convert existing parent-child template\_mapping to nested. During this process one of the scenario where more 10000 nested objects gets updated to a parent record is failing(which was working during parent-child mapping). The error we get is java heap out of memory exception(currently we use 1g of HEAP but tried increasing it to 5g but still fails). I am suspecting that the issue is caused by nested object updates as it causes re-indexing for every nested object update. When I try with 1000 records it works fine.

```auto
java.lang.OutOfMemoryError: Java heap space
Dumping heap to java_pid28.hprof ...
Unable to create java_pid28.hprof: Permission denied

```

any thoughts on this?
