Compiler threads
Stefan Reich
stefan.reich.maker.of.eye at googlemail.com
Sun Oct 13 17:51:35 UTC 2019
Hi Volker,
OK, so it seems the answer is basically "It's complicated, but we have
spent a lot of thought on sensible defaults"... :-)
log(N CPUs) * log(log(N CPUs) << that's pretty amazing though
Thanks,
Stefan
On Sun, 13 Oct 2019 at 19:48, Volker Simonis <volker.simonis at gmail.com>
wrote:
> Hi Stefan,
>
> the answer to your questions depends a little bit on the Java version
> you are using.
>
> In jdk8 you can use -XX:CICompilerCount=<n> to explicitly set the
> number of compiler threads and "-XX:+CICompilerCountPerCPU" to
> automatically set the number of compiler threads to "1 compiler thread
> for log(N CPUs)". If you use tiered compilation, which is the default,
> the "AdvancedThresholdPolicy" compilation policy will be used (can be
> controlled with "-XX:CompilationPolicyChoice=<n>"), which
> automatically enables "CICompilerCountPerCPU" but sets the number of
> compiler threads to log(N CPUs) * log(log(N CPUs)).
>
> In general, the number of compiler threads when using tiered
> compilation is distributed such that 1/3 of the total compiler threads
> will be tier 1 (i.e. C1) compiler threads and 2/3 will be tier 2 (i.e.
> C2) compiler threads.
>
> With jdk11 this system has been reworked and made more dynamic by
> introducing the option "-XX:+UseDynamicNumberOfCompilerThreads" which
> is active by default. It will automatically spawn new compiler
> threads, if the compilation queues get full (see
> https://bugs.openjdk.java.net/browse/JDK-8198756 and
> https://bugs.openjdk.java.net/browse/JDK-8201235 for a more detailed
> explanation of the parameter).
>
> Best regards,
> Volker
>
> On Sun, Oct 13, 2019 at 5:06 PM Stefan Reich
> <stefan.reich.maker.of.eye at googlemail.com> wrote:
> >
> > Just a quick question: How many compiler threads does HotSpot use? Does
> it
> > depend on then number of Java threads running?
> >
> > For example: Let's say I want the fastest startup time possible for a
> > single-thread application, so I want parallel JIT compilation on, say, 7,
> > out of 8 cores. Is that possible?
> >
> > Many greetings,
> > Stefan
> >
> > --
> > Stefan Reich
> > BotCompany.de // Java-based operating systems
>
--
Stefan Reich
BotCompany.de // Java-based operating systems
More information about the hotspot-dev
mailing list