# java heap error when using write to excel template node

**URL:** <https://forum.knime.com/t/java-heap-error-when-using-write-to-excel-template-node/73494>\
**Category:** KNIME Analytics Platform\
**Created:** [October 13, 2023, 1:26pm UTC](https://forum.knime.com/t/java-heap-error-when-using-write-to-excel-template-node/73494 "2023-10-13T13:26:22Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![mlauber71](https://forum-cdn.knime.com/user_avatar/forum.knime.com/mlauber71/32/73590_2.png) [@mlauber71](https://forum.knime.com/u/mlauber71)\
**Post date:** [October 20, 2023, 5:33pm UTC](https://forum.knime.com/t/java-heap-error-when-using-write-to-excel-template-node/73494/3 "2023-10-20T17:33:04Z")

</div>

> [@Heinz](#):
>
> Is there a way to relase the java heap memory?

There is the [Garbage Collection](https://forum.knime.com/t/execute-failed-java-heap-space/35585/2). More performance hints:

> **[Mastering KNIME: Unlocking Peak Performance with Expert Tips and Smart Settings](https://medium.com/low-code-for-advanced-data-science/mastering-knime-unlocking-peak-performance-with-expert-tips-and-smart-settings-49e2c0dab9cc)**
>
> The low-code tool KNIME is great and a lot of guides are out there to help you master it. You are encouraged to read the official ones…

> [@Heinz](#):
>
> Is there a better way to write to excel

Not sure if it is better but you can use OpenPyxl to append data to an existing excel sheet.

> [@Data extraction from .xls file/s](https://forum.knime.com/t/data-extraction-from-xls-file-s/29528/12):
>
> @Matt9301 there is a way to do this with the use of [Python](https://hub.knime.com/mlauber71/spaces/Public/latest/_knime_and_python_meta_collection) pandas and [openpyxl](https://openpyxl.readthedocs.io/en/stable/) You would have to provide an existing excel file and a sheet name and then sheets with the same structure.

And I assume it is necessary to write to a template to preserve the formats? Or would it be possible to write to a blank sheet and add the formats later?

---

_[View the full topic](https://forum.knime.com/t/java-heap-error-when-using-write-to-excel-template-node/73494)._
