Skip to content

Conversation

@lhotari
Copy link
Member

@lhotari lhotari commented Oct 17, 2025

Motivation

AbstractMetadataStore contains an unbounded childrenCache which might consume a lot of heap memory when a lot of namespaces with a lot of topics are listed. The cache has a timeout of 10 minutes so the memory usage problem is limited to certain use cases. For example, when all topics are listed for all namespaces in less than 10 minutes when there are a lot of namespaces and topics.

Modifications

Add a limit to the childrenCache so that oldest entries start to get expired when the cache consumes more than 20% of the maximum heap size.

Tests are TBD.

Documentation

  • doc
  • doc-required
  • doc-not-needed
  • doc-complete

@lhotari lhotari added this to the 4.2.0 milestone Oct 17, 2025
@lhotari lhotari self-assigned this Oct 17, 2025
@github-actions github-actions bot added the doc-not-needed Your PR changes do not impact docs label Oct 17, 2025
Copy link
Member

@dao-jun dao-jun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

// when a lot of namespaces with lots of topics are listed in the metadata store.
long defaultSizeBytes = heapMaxSizeBytes / 5;
// min size 20MB
int minSizeBytes = 1024 * 1024 * 20;
Copy link
Contributor

@Technoboy- Technoboy- Oct 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be better if it were configurable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

doc-not-needed Your PR changes do not impact docs ready-to-test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants