-
Notifications
You must be signed in to change notification settings - Fork 20
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
Implement rfc 0003 #95
Conversation
Signed-off-by: Daniel Mikusa <[email protected]>
- Set `-XX:+ExitOnOutOfMemoryError` for all apps, it is automatically appended to `JAVA_TOOL_OPTIONS` - If `$BPL_HEAP_DUMP_PATH` is set: - Take the contents as the path to which heap dumps will be written (must be a directory!) - Append a UUID to the end of the path, this creates a unique directory into which the dump will be written. This is necessary for environments like Kubernetes where many instances of an application could all be running at once. The UUID is logged so a user can look up the directory name into which the heap dump will be written. - If not set already, it adds `-XX:+HeapDumpOnOutOfMemoryError` to `JAVA_TOOL_OPTIONS` - If not set already, it adds `-XX:HeapDumpPath=<path>`, where `<path>` is sets to the path of the directory calculated in the first two steps above, to `JAVA_TOOL_OPTIONS`. Signed-off-by: Daniel Mikusa <[email protected]>
@pivotal-david-osullivan any chance you could take a look at this? I think this is sufficient for the first step of implementing RFC #3. It gets us most of the way to parity with the JVM kill agent & it's enough so that Java can run on the Tiny stack. To test:
Let me know your thoughts. Thanks |
- Pass in a file, not a directory - Do not use a UUID, instead use an RFC3339 formatted date The date is easier to correlate than a UUID, doesn't require a dependency, and should be unique enough. If we need something that's more unique, we can revisit this down the road. In addition, we switch from passing a folder as the heap path, because each time a container runs it will at most only ever write one file. Passing the full path to a file instead of a directory allows us to put the date into the file name itself, which seems a little more useful. Signed-off-by: Daniel Mikusa <[email protected]>
Based on feedback, I switch from using UUIDs to using an RFC3339 formatted date. This change allows you to retrieve dumps in at least two different ways:
Similar options are available when running on K8s. |
Summary
This is a partial implementation of RFC #0003.
It implements steps #1 and #2 in the parity section.
Use Cases
Checklist