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

[BUG] -XX:+UseContainerSupport not present in $JAVA_TOOL_OPTIONS for JAVA_VERSION >= 20 #306

Open
greghuc opened this issue Jun 21, 2024 · 2 comments

Comments

@greghuc
Copy link

greghuc commented Jun 21, 2024

Hi there

I just noticed that -XX:+UseContainerSupport is not present in $JAVA_TOOL_OPTIONS for my app running JAVA_VERSION="22.0.1" (this is the exact line in $JAVA_HOME/release file)

Eyeballing the code, this grep in jvmcommon.sh looks like it breaks for a JAVA_VERSION >= 20, since the regex only handles JAVA_VERSION=10..19

I presume this is a bug, rather than intentional?

Thanks

Greg

@Malax
Copy link
Member

Malax commented Jun 24, 2024

Hi @greghuc!

Thanks for opening this issue! You're absolutely right, this is not intentional. However, UseContainerSupport is enabled by default in the JVM/HotSpot for a long time now. This means that in practice this bug does not have any effect on the app. You should be able to verify this by printing the JVM flags on application startup with -XX:+PrintFlagsFinal.

Ultimately, the buildpack shouldn't set UseContainerSupport explicitly anymore as all supported versions enable this flag by default, even Java 8 (in newer versions).

I will keep this issue open to track that process.

Let me know if you have further input or questions, happy to discuss! :)

@greghuc
Copy link
Author

greghuc commented Jun 24, 2024

Hi @Malax

That all makes sense. Thanks for the update!

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

No branches or pull requests

2 participants