Skip to content

Bound feature flag evaluation aggregation memory - #12215

Draft
leoromanovsky wants to merge 1 commit into
masterfrom
agent/java-evaluation-aggregation-byte-budget
Draft

Bound feature flag evaluation aggregation memory#12215
leoromanovsky wants to merge 1 commit into
masterfrom
agent/java-evaluation-aggregation-byte-budget

Conversation

@leoromanovsky

@leoromanovsky leoromanovsky commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

Motivation

The current count limits do not bound retained heap when full evaluation data is enabled. JOL measured a typical 256-field bucket at 60,021 bytes. It measured a maximum legal bucket at 297,589 bytes. At the global count limit, these profiles project to 7.3 GiB and 36.3 GiB. This memory can remain until the 10-second flush.

Changes and Decisions

  • Enforce a conservative 64 MiB estimated byte budget across full and degraded aggregation buckets.
  • Merge existing buckets without a new byte reservation.
  • Route a new full bucket to degraded aggregation when the byte budget is full.
  • Drop the evaluation only when a degraded bucket cannot fit.
  • Keep the existing count limits as secondary guards.
  • Report byte-budget degradation and drops separately from cardinality limits.

Validation

JOL measured the retained object graph after the first byte-budget degradation:

  • Typical 256-field context: 735 full buckets and one degraded bucket retained 44,110,800 bytes.
  • Maximum 256-field context: 118 full buckets and one degraded bucket retained 35,115,816 bytes.
  • The estimator reserved 67,108,848 bytes and 66,840,328 bytes for these profiles.
  • Smaller profiles reached the per-flag limit first. Protected data retained 2,466,400 bytes. A typical 10-field context retained 26,866,360 bytes.

@leoromanovsky leoromanovsky added type: feature Enhancements and improvements tag: ai generated Largely based on code generated by an AI or LLM comp: openfeature OpenFeature labels Aug 15, 2026
@datadog-datadog-prod-us1

datadog-datadog-prod-us1 Bot commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 79.58% (+21.23%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 21b8641 | Docs | Datadog PR Page | Give us feedback!

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

Labels

comp: openfeature OpenFeature tag: ai generated Largely based on code generated by an AI or LLM type: feature Enhancements and improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant