Skip to content

Bound evaluation queue memory - #12219

Draft
leoromanovsky wants to merge 2 commits into
masterfrom
agent/java-evaluation-queue-byte-budget
Draft

Bound evaluation queue memory#12219
leoromanovsky wants to merge 2 commits into
masterfrom
agent/java-evaluation-queue-byte-budget

Conversation

@leoromanovsky

Copy link
Copy Markdown
Contributor

Motivation

The 4,096-entry evaluation queue limits event count, but it does not limit retained context bytes. JOL measured 81.3 MB for a full queue of flattened 100-field contexts. A full queue of maximum legal contexts projects 672.1 MB. Slow EVP delivery can retain this memory.

This change limits the conservative queue estimate to 16 MiB.

Changes and Decisions

  • Calculate context bytes during the existing bounded context copy. Enqueue and release do not walk the context.
  • Store the immutable total on each event. This avoids a second queue wrapper allocation.
  • Reserve bytes with a non-blocking atomic operation before the queue offer. Keep 4,096 entries as a secondary limit.
  • Batch worker releases to 64 KiB. This reduces producer and worker cache-line handoff.
  • Release all reservations during drain and close. Use a separate atomic path for producer cancellation.
  • Report queue_byte_budget separately from queue_overflow.

Validation

  • JOL: the 100-field profile stopped at 639 events and retained 12.1 MiB. The maximum profile stopped at 56 events and retained 8.8 MiB.
  • JMH: writer enqueue increased from 15.0-16.4 ns to 17.7-19.5 ns across three profiles. Allocation increased by 8 bytes per event.
  • JMH: the 100-field hook increased from 1,044.4 ns to 1,086.9 ns, or 4.1%. Allocation increased by 8 bytes.
  • JMH producer/consumer groups: one producer increased from 53.1 ns to 77.4 ns. Four and 16 producer results had overlapping confidence intervals.

These are controlled JDK 26 measurements. They are not production results.

@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 16, 2026
@datadog-datadog-us1-prod

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

Copy link
Copy Markdown

🎯 Code Coverage (details)
Patch Coverage: 95.28%
Overall Coverage: 78.32% (+19.97%)

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

@dd-octo-sts

dd-octo-sts Bot commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

🟢 Java Benchmark SLOs — All performance SLOs passed

Suite Status
Startup 🟢 pass

SLO thresholds are defined here based on automatically generated metrics. A warning is raised when results are within 5% of the threshold.

PR vs. master results
Scenario Candidate master Δ (95% CI of mean)
startup:insecure-bank:iast:Agent 14.01 s 13.96 s [-0.4%; +1.1%] (no difference)
startup:insecure-bank:tracing:Agent 12.98 s 12.99 s [-1.1%; +1.0%] (no difference)
startup:petclinic:appsec:Agent 17.42 s 16.68 s [+0.0%; +8.8%] (maybe worse)
startup:petclinic:iast:Agent 16.76 s 17.41 s [-8.0%; +0.5%] (no difference)
startup:petclinic:profiling:Agent 17.31 s 17.23 s [-0.8%; +1.7%] (no difference)
startup:petclinic:sca:Agent 17.10 s 17.20 s [-1.8%; +0.6%] (no difference)
startup:petclinic:tracing:Agent 16.41 s 16.49 s [-1.4%; +0.4%] (no difference)

Commit: be0d0078 · CI Pipeline · Benchmarking Platform UI


Load and DaCapo benchmarks can be triggered manually in the GitLab pipeline. Results will appear in the Benchmarking Platform UI after completion.

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