Skip to content
This repository was archived by the owner on Apr 3, 2026. It is now read-only.

nobeh/jmh-forked-main-threads

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NOTE Fixed in https://bugs.openjdk.java.net/browse/CODETOOLS-7901244

This is a sample project to demonstrate if the application in ForkedMain cannot completely shut down the running threads, then JMH is not able to finalize and complete the benchmark.

To run the sample, you need to have Java 8. Simply run:

$ ./run.sh

Then you can use jps and jstack -l on ForkedMain to observe that there are still running threads inside it and JMH is still waiting on them.

To start with, look at ApplicationBenchmark. Change how the application is shut down through the chain in #teardown() and it is observable that JMH completes the benchmark.

About

A showcase on JMH ForkedMain with running threads not shutting down on `TearDown`

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors