Skip to content

Commit

Permalink
Switch profiling from HPROF to Java Flight Recorder.
Browse files Browse the repository at this point in the history
After the switch to Java 11 (#343), the JVM TI hprof Agent (introduced in e144936) is no longer available (removed in JDK 9, see https://bugs.openjdk.org/browse/JDK-8046661).

Use the `jfr` command-line tool or JDK Mission Control (https://jdk.java.net/jmc/) to analyze the recording file.
  • Loading branch information
blackwinter committed Oct 18, 2024
1 parent ea9fa70 commit 8ea116a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ out/
node_modules/
xtext-server/
package-lock.json
*.hprof.txt
*.jfr
*.vsix
/metafix/src/test/resources/org/metafacture/metafix/integration/**/*.diff
/metafix/src/test/resources/org/metafacture/metafix/integration/**/*.err
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ plugins {
// excludes = [
// '**/*.diff',
// '**/*.err',
// '**/*.hprof.txt',
// '**/*.jfr',
// '**/*.out',
// '**/*.vsix',
// '**/.*',
Expand Down
6 changes: 4 additions & 2 deletions metafix-runner/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,10 @@ application {
if (project.hasProperty('profile')) {
def file = project.getProperty('profile') ?: project.name
def depth = project.hasProperty('profile.depth') ? project.getProperty('profile.depth') : 8
def cutoff = project.hasProperty('profile.cutoff') ? project.getProperty('profile.cutoff') : 0.001

applicationDefaultJvmArgs = ["-agentlib:hprof=heap=sites,cpu=samples,depth=${depth},cutoff=${cutoff},file=${file}.hprof.txt"]
applicationDefaultJvmArgs = [
"-XX:FlightRecorderOptions=stackdepth=${depth}",
"-XX:StartFlightRecording=dumponexit=true,filename=${file}.jfr,settings=profile"
]
}
}

0 comments on commit 8ea116a

Please sign in to comment.