> Here is another, hopefully, closer to the final iteration of NMT benchmarking > mechanism. > > To use, you first need to record the pattern of operations, ex: > > `./build/macosx-aarch64-server-release/xcode/build/jdk/bin/java > -XX:+UnlockDiagnosticVMOptions -XX:NMTRecordMemoryAllocations=0x7FFFFFFF -jar > build/macosx-aarch64-server-release/images/jdk/demo/jfc/J2Ddemo/J2Ddemo.jar` > > This will run the target app, and log all the allocations in chronological > order. This will produce a few files: > - hs_nmt_pid22770_allocs_record.log (is the chronological record of the the > desired operations) > - hs_nmt_pid22770_info_record.log (is the record of default NMT memory > overhead and the NMT state) > - hs_nmt_pid22770_threads_record.log (is the record of thread names that can > be retrieved later when processing) > > Now you can use those recording to actually benchmark your proposed changes, > ex: > > `./build/macosx-aarch64-server-release/xcode/build/jdk/bin/java > -XX:+UnlockDiagnosticVMOptions -XX:NMTBenchmarkRecordedPID=22770 > -XX:NMTBenchmarkRecordedLoops=10` > > Which will produce yet another file: > > - hs_nmt_pid23527_benchmark.log > > that contains the details of the session, which can be further processed and > analyzed by a tool, such as the one in jdk/src/utils/nmt, however, if you are > looking just for one performance number look for `time:2744190[ns] > [samples:115263]` in the output. > > The total time for this particular run is 2,744,190 nanosecond or ~2.7 > seconds, which you can use to compare `before` and `after` your change.
Gerard Ziemski has updated the pull request incrementally with one additional commit since the last revision: move the optional tool into it's own issue/PR ------------- Changes: - all: https://git.openjdk.org/jdk/pull/23115/files - new: https://git.openjdk.org/jdk/pull/23115/files/a925e3d5..cf8acc0a Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=23115&range=02 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=23115&range=01-02 Stats: 2461 lines in 16 files changed: 0 ins; 2461 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/23115.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/23115/head:pull/23115 PR: https://git.openjdk.org/jdk/pull/23115