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

ScheduledExecutorService to remove timeout objects on cancel #2426

Merged
merged 1 commit into from
Nov 18, 2022

Conversation

Scottmitch
Copy link
Member

Motivation:
By default the JDK's ScheduledExecutorService does not remove timer objects from its queues upon cancel. Cancellation is expected to be common when requests have timeouts applied, and therefore the object retention lifetime will be longer than required and may negatively impact GC performance.

Motivation:
By default the JDK's ScheduledExecutorService does not remove timer
objects from its queues upon cancel. Cancellation is expected to
be common when requests have timeouts applied, and therefore the
object retention lifetime will be longer than required and may
negatively impact GC performance.
Copy link
Member

@idelpivnitskiy idelpivnitskiy left a comment

Choose a reason for hiding this comment

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

Good idea!

@Scottmitch Scottmitch merged commit d6476f7 into apple:main Nov 18, 2022
@Scottmitch Scottmitch deleted the timer_task_cancel_remove branch November 18, 2022 08:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants