How should I stop the forked VM?
Aleksey Shipilev
aleksey.shipilev at oracle.com
Tue Jan 13 09:38:14 UTC 2015
Hi Behrooz,
On 01/13/2015 11:20 AM, Behrooz Nobakht wrote:
> Thanks for your reply. Hope this helps:
> https://github.com/nobeh/jmh-forked-main-threads
Thanks for the repoducer!
I still believe this is a library bug to have stray non-daemon threads
floating around like that. That means any user would have to use
System.exit() to terminate the application, which is smelly smelly smell
that smells a lot.
Nevertheless, JMH can do a little better:
https://bugs.openjdk.java.net/browse/CODETOOLS-7901244
http://hg.openjdk.java.net/code-tools/jmh/rev/d15ebde32b25
It will now wait for the forked VM to exit properly on its own, and
forcefully terminate the VM if the shutdown timeout is reached. The
timeout is now at 30 seconds. If you want to have a better turnaround
for these benchmarks, submit the upstream bug and demand the library to
stop using the non-daemon threads.
Thanks,
-Aleksey.
More information about the jmh-dev
mailing list