Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory is not released on dispose causing OOM #376

Open
OverLord561 opened this issue Dec 3, 2024 · 2 comments
Open

Memory is not released on dispose causing OOM #376

OverLord561 opened this issue Dec 3, 2024 · 2 comments

Comments

@OverLord561
Copy link

OverLord561 commented Dec 3, 2024

Hi Folks!

I am using [email protected] + [email protected] like below:
image

Value - huge object, generated during Server Side Rendering.

The problem:

  • memory is not released on dispose
  • adding new items evict old entities but the total memory is slowly growing, causing OOM
  • ttlAutopurge: true expires the entities but does not release the memory

Possible way to release memory:

  • manually clear the cache inside setTimeout() which is not the option

What is the best memory releasing strategy?

Thanks in advance!

@OverLord561
Copy link
Author

OverLord561 commented Dec 4, 2024

I`d like to add that I use express.js app.
I simulate high load by executing simple HTTP request like setTimeout(() => {executor()}, 100).

From the logs I see that not all LRU items are properly evicted.

Every time all the items are supposed to be expired and pruned but a few are still in the memory.
image

@OverLord561
Copy link
Author

Identified that the items are not properly evicted due to updateAgeOnGet & updateAgeOnHas presence.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant