# Observing significant memory consumption increase after 1 hour of the workflow completion

**URL:** <https://community.temporal.io/t/observing-significant-memory-consumption-increase-after-1-hour-of-the-workflow-completion/11043>\
**Category:** Community Support\
**Tags:** java-sdk\
**Created:** [February 16, 2024, 7:19pm UTC](https://community.temporal.io/t/observing-significant-memory-consumption-increase-after-1-hour-of-the-workflow-completion/11043 "2024-02-16T19:19:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![wshv](https://avatars.discourse-cdn.com/v4/letter/w/b9e5f3/32.png) [@wshv](https://community.temporal.io/u/wshv)\
**Post date:** [February 16, 2024, 7:19pm UTC](https://community.temporal.io/t/observing-significant-memory-consumption-increase-after-1-hour-of-the-workflow-completion/11043/1 "2024-02-16T19:19:23Z")

</div>

We are doing some experiments around the Temporal Java SDK client memory consumption. We also developed a small tool to keep track of the application process’s memory consumption and plot it

These experiments are performed in such a way: at the beginning of measurement period, we trigger the workflow which will run exactly 1 hour. After workflow completes, we won’t trigger anything else and just keep the measurement ongoing to see the performance of temporal client in the idle state

To set up a baseline, the application that we embed our client takes around 710 MiB of memory. Its memory consumption is very stable and won’t vary too much over the time.

In several experiments we observe one common patterns

1. There is a significant increase of memory consumption happens around **1 hour** after the completion of workflow. This can be indicated by the sudden steep increase of memory in the plot

For example,  
 ![memory-025](https://us1.discourse-cdn.com/flex016/uploads/temporal/original/2X/6/67ca85369c9d87c1a60b95a993b92184e5a46588.png)

![memory-026](https://us1.discourse-cdn.com/flex016/uploads/temporal/original/2X/9/969128a9fd0264911b7d5fd8d3860bd527ac3529.png)

and many more

In the last example, the workflow completes at 2024-02-16 10:22:04.77

Looking at the memory consumption, we can see a sudden increase occurs after 1 hour at 2024-02-16 11:23:12

 ![Screenshot 2024-02-16 at 11.10.41 AM](https://us1.discourse-cdn.com/flex016/uploads/temporal/original/2X/7/7d48cb67fdc066c30fdecc0c3074eb46b5372580.png)  
from 756.83MiB to 767.37MiB.

We are looking for some potential explanation to understand why is always a sudden increase of memory consumption on the SDK client side one hour after last workflow completion? Understanding this behavior will help us better tailor the Temporal client based on our requirements. Thanks

---

<div class="post-metadata">

**Author:** ![Hemant\_Joshi](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/hemant_joshi/32/4767_2.png) [@Hemant\_Joshi](https://community.temporal.io/u/Hemant_Joshi)\
**Post date:** [February 16, 2024, 7:40pm UTC](https://community.temporal.io/t/observing-significant-memory-consumption-increase-after-1-hour-of-the-workflow-completion/11043/2 "2024-02-16T19:40:38Z")

</div>

Hi @maxim and @tihomir ,  
I am seeing the same behavior. Is there a memory leak due to periodic workflow? If not, is there a way we can keep memory usage stable if no workflow is running?

---

<div class="post-metadata">

**Author:** ![wshv](https://avatars.discourse-cdn.com/v4/letter/w/b9e5f3/32.png) [@wshv](https://community.temporal.io/u/wshv)\
**Post date:** [February 20, 2024, 9:35pm UTC](https://community.temporal.io/t/observing-significant-memory-consumption-increase-after-1-hour-of-the-workflow-completion/11043/3 "2024-02-20T21:35:26Z")

</div>

Please help!

---

<div class="post-metadata">

**Author:** ![maxim](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/maxim/32/8_2.png) [@maxim](https://community.temporal.io/u/maxim)\
**Post date:** [February 20, 2024, 9:43pm UTC](https://community.temporal.io/t/observing-significant-memory-consumption-increase-after-1-hour-of-the-workflow-completion/11043/4 "2024-02-20T21:43:53Z")

</div>

I would recommend taking the heap dump of the process before and after 1 hour to see what objects consume the space.
