Skip to content

Commit 8ea116a

Browse files
committed
Switch profiling from HPROF to Java Flight Recorder.
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.
1 parent ea9fa70 commit 8ea116a

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ out/
66
node_modules/
77
xtext-server/
88
package-lock.json
9-
*.hprof.txt
9+
*.jfr
1010
*.vsix
1111
/metafix/src/test/resources/org/metafacture/metafix/integration/**/*.diff
1212
/metafix/src/test/resources/org/metafacture/metafix/integration/**/*.err

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ plugins {
88
// excludes = [
99
// '**/*.diff',
1010
// '**/*.err',
11-
// '**/*.hprof.txt',
11+
// '**/*.jfr',
1212
// '**/*.out',
1313
// '**/*.vsix',
1414
// '**/.*',

metafix-runner/build.gradle

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,10 @@ application {
4242
if (project.hasProperty('profile')) {
4343
def file = project.getProperty('profile') ?: project.name
4444
def depth = project.hasProperty('profile.depth') ? project.getProperty('profile.depth') : 8
45-
def cutoff = project.hasProperty('profile.cutoff') ? project.getProperty('profile.cutoff') : 0.001
4645

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

0 commit comments

Comments
 (0)