Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

ArrayList<Runnable> memory allocations #1646

tttomat19 started this conversation in General
Discussion options

Describe the bug

I can see a lot of allocations from List<Runnable> block = new ArrayList<Runnable>(size);

MAX_RUNNABLE_BLOCK_SIZE is 256 and not configurable

Could it be smaller?

To be fair I'm not sure, just JMC shows allocations are right there.

Reproduction steps

about 4k messages per second input * about 1kb size each

Expected behavior

Less wasted allocations from here

Additional context

No response

You must be logged in to vote

Replies: 2 comments

Comment options

@tttomat19 if you are not sure and wouldn't share any details beyond "too many" allocations, then why did you file this as a bug?

You must be logged in to vote
0 replies
Comment options

MAX_RUNNABLE_BLOCK_SIZE is a constant on the consumer operation dispatch hot path.

Changing that constant therefore can and will affect the throughput, in particular for the workloads that use multiple channels and high QoS prefetch values.

@tttomat19 you are welcome to use a smaller value and report what do the benchmarks look like. Given that this is not a common complaint and the value used is similar to the prefetch value range that's considered to be optimal (going over 300-400 usually produces no throughput improvement), I doubt there will be a lot of interest in tweaking this value.

Making it configurable via ConnectionFactory and such is an option, you are welcome to submit a PR.

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Converted from issue

This discussion was converted from issue #1646 on July 14, 2025 15:53.

AltStyle によって変換されたページ (->オリジナル) /