JMH hangs between benchmarks (unable to kill forked JVM?)
Aleksey Shipilev
aleksey.shipilev at oracle.com
Wed Feb 19 00:38:29 PST 2014
On 02/19/2014 12:23 PM, Leszek Bartkowski wrote:
> If I kill forked JVM manually the whole process unblocks. However
> after finishing next benchmark it gets stuck again... Any ideas why
> does it happen? And why it does NOT happen when I fire off the same
> benchmark separately?
We usually experience something like that when you don't close some
resource preventing forked VM to exit: non-daemon threads, unfinished
children tasks, etc. Can you replicate this and try to get the jstack on
the forked VM (it should have ForkedMain as the entry point)?
> Also, is there some timeout option in JMH, so it kills forked process
> forcefully if normal shutdown takes too long?
There is none, because the reliable "kill" for the forked VM is very
hard to implement. It would be OK if we could just leave the stuck VM
alone, and move on, but that is a bad idea for the performance
measurement. We opted to catch fire and freeze if the forked VM
misbehaves, pushing users to investigate and fix the workload.
-Aleksey.
More information about the jmh-dev
mailing list