How should I stop the forked VM?
nobeh5 at gmail.com
Tue Jan 13 08:20:17 UTC 2015
Thanks for your reply. Hope this helps:
On Mon, Jan 12, 2015 at 10:57 AM, Aleksey Shipilev <
aleksey.shipilev at oracle.com> wrote:
> On 01/12/2015 12:50 PM, Behrooz Nobakht wrote:
> > So I started to use jstack -l on the ForkedMain for my benchmark. Here
> > some observations:
> > - There are threads all with TIMED_WAITING state.
> > - I do not have explicit control over the above threads.
> > - If I do a System.exit(0) somewhere inside ForkedMain, then JMH is
> > annoyed and will not continue.
> I smell a bug here, can you produce a minimal scenario?
> > Is there a way, I can safely, issue a System.exit() and JMH would
> > to finalize the benchmark?
> Calling System.exit() from the benchmark running in a forked VM should
> produce a benchmark failure, while still properly shutting down the
> forked VM.
> There is no way to call a magic method and have a graceful shutdown. You
> have to control the threads. As the minimal option, you have to make the
> threads daemon, so that their existence would not prevent forked VM from
-- Behrooz Nobakht
More information about the jmh-dev