# History service memory usage

**URL:** <https://community.temporal.io/t/history-service-memory-usage/5569>\
**Category:** Community Support\
**Tags:** history\
**Created:** [August 3, 2022, 5:07pm UTC](https://community.temporal.io/t/history-service-memory-usage/5569 "2022-08-03T17:07:18Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![tihomir](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/tihomir/32/6580_2.png) [@tihomir](https://community.temporal.io/u/tihomir)\
**Post date:** [August 8, 2022, 6:31pm UTC](https://community.temporal.io/t/history-service-memory-usage/5569/4 "2022-08-08T18:31:06Z")

</div>

Hi, sorry for late reply on this.

Do you make any changes in config regarding history cache sizes? Specifically settings:

`history.cacheInitialSize` default 128

`history.cacheMaxSize` default 512

`history.eventsCacheInitialSize` default 128

`history.eventsCacheMaxSize` default 512

These are per shard configurations, how many history shards do you define for cluster?

Caches items should be cleared if the the limits max size is reached. There is no periodic cache cleaning.

Regarding the error, are you getting resource exhausted errors? If you have server metrics enabled check maybe:

`sum(rate(service_errors_resource_exhausted{}[1m])) by (resource_exhausted_cause)`

---

_[View the full topic](https://community.temporal.io/t/history-service-memory-usage/5569)._
