Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#4147] Allow to disable recycling #4157

Closed
wants to merge 1 commit into from
Closed

Conversation

normanmaurer
Copy link
Member

Motivation:

Sometimes it is useful to disable recycling completely if memory constraints are very tight.

Modifications:

Allow to use -Dio.netty.recycler.maxCapacity.default=0 to disable recycling completely.

Result:

It's possible to disable recycling now.

@normanmaurer
Copy link
Member Author

@trustin please check

private static final AtomicInteger ID_GENERATOR = new AtomicInteger(Integer.MIN_VALUE);
private static final int OWN_THREAD_ID = ID_GENERATOR.getAndIncrement();
// TODO: Some arbitrary large number - should adjust as we get more production experience.
private static final int DEFAULT_INITIAL_MAX_CAPACITY = 262144;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we stick to this default value? /cc @normanmaurer @tea-dragon

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@trustin for now yes. Let us use a new pr if we want to adjust it

@trustin
Copy link
Member

trustin commented Aug 28, 2015

Could we log that recycler has been disabled explicitly?

@trustin
Copy link
Member

trustin commented Aug 28, 2015

Just one trivial comment about logging. How about logging 'disabled' instead of '0' in the logging statement here?

Motivation:

Sometimes it is useful to disable recycling completely if memory constraints are very tight.

Modifications:

Allow to use -Dio.netty.recycler.maxCapacity.default=0 to disable recycling completely.

Result:

It's possible to disable recycling now.
@normanmaurer
Copy link
Member Author

Cherry-picked into 4.0 (01c29e5), 4.1 (1a9ea2d) and master (910ae03)

@normanmaurer normanmaurer deleted the disable_recycle branch August 28, 2015 13:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants