[DMARC FAILURE] Re: Compiler threads

Doerr, Martin martin.doerr at sap.com
Mon Oct 14 13:36:28 UTC 2019


Hi Stefan,

> log(N CPUs) * log(log(N CPUs) << that's pretty amazing though
This formula is from a time before UseDynamicNumberOfCompilerThreads was introduced.
I guess people usually don't want to spend all their hardware threads for JIT compilation,
but it may be beneficial to use a higher value depending on your scenario.
With UseDynamicNumberOfCompilerThreads, CICompilerCount sets the upper limit. The JVM will dynamically add and remove threads between 1 per type and 1/3 for C1 2/3 for C2 of this value in total.

Best regards,
Martin


> -----Original Message-----
> From: hotspot-dev <hotspot-dev-bounces at openjdk.java.net> On Behalf Of
> Stefan Reich
> Sent: Sonntag, 13. Oktober 2019 19:52
> To: Volker Simonis <volker.simonis at gmail.com>
> Cc: hotspot-dev Source Developers <hotspot-dev at openjdk.java.net>
> Subject: [DMARC FAILURE] Re: Compiler threads
> 
> 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