-
Notifications
You must be signed in to change notification settings - Fork 9
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
Configure runtime augument for java native image #252
Comments
I haven't tried it, but you might also try sending the SIGUSR1 signal. That might let you trigger a heap dump without modifying the start command. |
Hi @dmikusa set the default process with arguments using https://buildpacks.io/docs/app-developer-guide/run-an-app/#default-process-type-with-additional-arguments do not work well because Java native image layer is not put into the runtime image. the /layers show only the ca-certificate buildpack layer is put into the final container image. So it may need the buildpack to do some changes to support the heapdump/jfr shoubleshooting, like the default path for the dump file needs to be changed. Besides, I didn't use the |
Yes, the application binary gets moved into
I don't think that My understanding of At any rate, if GraalVM does not give you a way to change where the heap dump is written, there's not a lot you can do, besides the custom route. |
Thanks @dmikusa
From GraalVM dev build, I see that the
Yes, I think so, it's different with So I think maybe the heapdump/JFR throubleshooting is not support well in native image |
I'm not sure why they would remove the ability to set the heap dump path. Maybe ask the GraalVM team? We can't really do anything without that option because even if we published the native-image layer, that would be a read-only layer so it couldn't be written to. I'm sure we're not the only ones creating images where the JVM is on a read-only layer. It has to have some way to write the heap dump elsewhere. You might also ask if they plan to add an option like |
The default path for heap dump file is
The executable file Is it a bug in native-image buildpack? see https://github.com/paketo-buildpacks/native-image/blob/main/native/arguments.go#L159 |
No, that's intentional. The native-image file is put in the layer so that it can be cached. If you rebuild and your application hasn't changed, then it'll reuse that layer and skip the expensive build. Could it be done differently? Yes. There are probably 5 different ways you could technically handle this, but presently it's working the way it was designed. |
I use kpack 0.9.2 and java-native-image.
From GraalVM Debugging and Diagnostics doc, I want to configure heapdump, see the doc: https://www.graalvm.org/22.3/reference-manual/native-image/guides/create-heap-dump/
In build phase, add
BP_NATIVE_IMAGE_BUILD_ARGUMENTS="--enable-monitoring=heapdump"
In runtime phase, I hope to run
{command} -XX:+DumpHeapAndExit
, but there is no place to pass-XX:+DumpHeapAndExit
. I directly run the command in a container, the error shows:Expected Behavior
Current Behavior
should pass some argument to runtime phase
Possible Solution
Steps to Reproduce
Motivations
The text was updated successfully, but these errors were encountered: