Skip to content

Impose a limit on the compilation queue size - #14056

Merged
dsouzai merged 1 commit into
eclipse-openj9:masterfrom
mpirvu:limitQSZ
Dec 2, 2021
Merged

Impose a limit on the compilation queue size#14056
dsouzai merged 1 commit into
eclipse-openj9:masterfrom
mpirvu:limitQSZ

Conversation

@mpirvu

@mpirvu mpirvu commented Dec 2, 2021

Copy link
Copy Markdown
Contributor

In corner cases the compilation queue size can grow to tens of
thousand of entries. A large compilation queue adds overhead in
terms of memory and CPU (inserting an entry requires queue scanning
to find the proper place). To avoid these overheads, this commit
imposes a limit for the compilation queue size. When the limit is
reached, future asynchronous compilation requests for interpreted
methods are rejected, and the invocation count for the methods in
question is replenished. The rejected methods will continue to
run interpreted until their invocation count reaches 0 again.
Postponing such compilation requests is not expected to be detrimental
to performance because those methods would have waited a very
long time in the queue anyway.
This compilation queue size limit does not apply to recompilation
requests, to JNI methods (which don't use an invocation count) or
to synchronous requests which need to be processed as soon as possible.
The default value for the compilation queue size limit is set to 5000.
This value can be changed with -Xjit:compilationQueueSizeLimit=
This feature can be disabled by setting a very large value for the
compilation queue size limit.

Partially addresses issue #13807

Signed-off-by: Marius Pirvu mpirvu@ca.ibm.com

In corner cases the compilation queue size can grow to tens of
thousand of entries. A large compilation queue adds overhead in
terms of memory and CPU (inserting an entry requires queue scanning
to find the proper place). To avoid these overheads, this commit
imposes a limit for the compilation queue size. When the limit is
reached, future asynchronous compilation requests for interpreted
methods are rejected, and the invocation count for the methods in
question is replenished. The rejected methods will continue to
run interpreted until their invocation count reaches 0 again.
Postponing such compilation requests is not expected to be detrimental
to performance because those methods would have waited a very
long time in the queue anyway.
This compilation queue size limit does not apply to recompilation
requests, to JNI methods (which don't use an invocation count) or
to synchronous requests which need to be processed as soon as possible.
The default value for the compilation queue size limit is set to 5000.
This value can be changed with -Xjit:compilationQueueSizeLimit=<NNN>
This feature can be disabled by setting a very large value for the
compilation queue size limit.

Partially addresses issue eclipse-openj9#13807

Signed-off-by: Marius Pirvu <mpirvu@ca.ibm.com>
@mpirvu mpirvu added the comp:jit label Dec 2, 2021
@mpirvu

mpirvu commented Dec 2, 2021

Copy link
Copy Markdown
Contributor Author

jenkins compile all jdk11

@mpirvu
mpirvu requested a review from dsouzai December 2, 2021 05:39
@mpirvu

mpirvu commented Dec 2, 2021

Copy link
Copy Markdown
Contributor Author

jenkins test sanity.functional zlinux jdk17

@mpirvu

mpirvu commented Dec 2, 2021

Copy link
Copy Markdown
Contributor Author

@dsouzai Please review/merge this PR. Tests have passed. Thanks!

@dsouzai dsouzai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, except for a question I had.

Comment thread runtime/compiler/control/CompilationRuntime.hpp
@dsouzai
dsouzai merged commit 3cbebb1 into eclipse-openj9:master Dec 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants