Skip to content

perf(feature-flagging): bound UFC response memory - #12214

Draft
leoromanovsky wants to merge 1 commit into
masterfrom
agent/java-bound-ufc-response-memory
Draft

perf(feature-flagging): bound UFC response memory#12214
leoromanovsky wants to merge 1 commit into
masterfrom
agent/java-bound-ufc-response-memory

Conversation

@leoromanovsky

Copy link
Copy Markdown
Contributor

Motivation

The client accepted UFC responses without a size limit. A 12 MiB identity response allocated 25,281,544 bytes. A 20 MiB gzip expansion allocated 42,374,176 bytes from 20,405 compressed bytes. A large response could exhaust the application heap.

Changes and Decisions

  • Limit compressed response data to 10 MiB.
  • Limit decompressed UFC data to 10 MiB. This limit matches the Go implementation.
  • Request gzip explicitly and decode it through bounded streams.
  • Reject a known oversized response before reading its body.
  • Enforce the same limits for chunked responses and incorrect content lengths.
  • Do not retry size-limit failures. Keep the last valid configuration and ETag.
  • Do not buffer non-200 response bodies.

Validation

The same allocation probe rejected the 12 MiB identity response after 1,769,896 allocated bytes. It rejected the gzip expansion at 10 MiB after 10,607,168 allocated bytes.

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

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

Copy link
Copy Markdown

🎯 Code Coverage (details)
Patch Coverage: 98.61%
Overall Coverage: 79.59% (+21.24%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 8f7fdd2 | 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