-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #304 from graalvm/ni-demos-refactoring-3
[GR-60094] Refactor the demo for Create a Heap Dump from a Native Executable guide.
- Loading branch information
Showing
12 changed files
with
57 additions
and
183 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: native-image/create-heap-dumps | ||
on: | ||
push: | ||
paths: | ||
- 'native-image/create-heap-dumps/**' | ||
- '.github/workflows/native-image-create-heap-dumps.yml' | ||
pull_request: | ||
paths: | ||
- 'native-image/create-heap-dumps/**' | ||
- '.github/workflows/native-image-create-heap-dumps.yml' | ||
schedule: | ||
- cron: "0 0 1 * *" # run every month | ||
workflow_dispatch: | ||
permissions: | ||
contents: read | ||
jobs: | ||
run: | ||
name: Run 'native-image/create-heap-dumps' | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 15 | ||
strategy: | ||
matrix: | ||
java-version: ['21', '24-ea'] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: graalvm/setup-graalvm@v1 | ||
with: | ||
java-version: ${{ matrix.java-version }} | ||
distribution: 'graalvm' | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
native-image-job-reports: 'true' | ||
- name: Run 'native-image/create-heap-dumps' | ||
run: | | ||
cd native-image/create-heap-dumps | ||
./run.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
1 change: 1 addition & 0 deletions
1
native-heapdump-examples/.gitignore → native-image/create-heap-dumps/.gitignore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
*.class | ||
*.txt | ||
helloworld | ||
svmheapdump | ||
*.hprof | ||
svmheapdumpapi | ||
|
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Create a Heap Dump from a Native Executable | ||
|
||
You can find the steps to run this demo on [the website](https://www.graalvm.org/latest/reference-manual/native-image/guides/create-heap-dump/). |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/usr/bin/env bash | ||
set -ex | ||
|
||
# Dump the Initial Heap of a Native Executable | ||
javac HelloWorld.java | ||
native-image -Ob HelloWorld --enable-monitoring=heapdump | ||
./helloworld -XX:+DumpHeapAndExit | ||
|
||
# Create a Heap Dump with SIGUSR1 (Linux/macOS only) | ||
javac SVMHeapDump.java | ||
native-image -Ob SVMHeapDump --enable-monitoring=heapdump | ||
./svmheapdump | ||
|
||
# Create a Heap Dump from within a Native Executable | ||
javac SVMHeapDumpAPI.java | ||
native-image -Ob SVMHeapDumpAPI | ||
./svmheapdumpapi --heapdump |