Skip to content

[GR-39407] Add an env variable like JAVA_TOOL_OPTIONS #4650

@dmikusa

Description

@dmikusa

Feature request

Please include the following information:

Is your feature request related to a problem? Please describe.

When running apps with a JVM, you have the option to set flags for the JVM (like -Xmx) through the JAVA_TOOL_OPTIONS env variable. This is handy in environments where it's not practical or possible to manipulate the process arguments.

Given that you can feed in some GC configuration parameters as process arguments, https://www.graalvm.org/22.1/reference-manual/native-image/MemoryManagement/, it would be convenient if you could do this through an env variable as well.

Describe the solution you'd like.

I can understand not wanting to support JAVA_TOOL_OPTIONS in GraalVM as it might be confusing or get misused. It would be helpful if we could have a differently named environment variable that functions in the same way. For example, NATIVE_IMAGE_OPTIONS or GRAALVM_OPTIONS.

Describe who do you think will benefit the most.
GraalVM users & developers of libraries and frameworks which depend on GraalVM.

My personal use case is the latter. I work on the Paketo Buildpacks project and we integrate GraalVM into buildpacks. It is tricky and less flexible for our users to set arguments than env variables.

Describe alternatives you've considered.

You can set flags as arguments to the process, but this isn't as flexible and causes issues for Cloud-Native buildpack users.

Additional context.

N/A

Express whether you'd like to help contributing this feature

No

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions