RFR: 8366082: Improve queue size computation in CPU-time sampler

Johannes Bechberger jbechberger at openjdk.org
Mon Aug 25 14:11:57 UTC 2025


On Mon, 25 Aug 2025 13:31:47 GMT, Kerem Kat <krk at openjdk.org> wrote:

>> Improve the sample queue size computation for the CPU-time sampler by increasing the size dynamically when needed, but keeping the default size small.
>
> src/hotspot/share/jfr/periodic/sampling/jfrCPUTimeThreadSampler.cpp line 185:
> 
>> 183:     }
>> 184:     if (factor > 1) {
>> 185:       u4 new_capacity = _capacity * factor > CPU_TIME_QUEUE_MAX_CAPACITY ? CPU_TIME_QUEUE_MAX_CAPACITY : capacity * factor;
> 
> I noticed the check uses `_capacity` but the assignment uses `capacity`. Should both be using `capacity`?

good catch :)

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/26926#discussion_r2298221961


More information about the hotspot-jfr-dev mailing list