ForkJoinTask[] instances

Alan Bateman Alan.Bateman at oracle.com
Fri Nov 20 10:35:57 UTC 2020


On 20/11/2020 09:33, Dr Heinz M. Kabutz wrote:
> Good morning from Crete,
>
> I started an experiment 11 days ago with 2 million virtual threads in 
> one JVM sending ping messages to another 2 million virtual threads in 
> another JVM. It has been happily humming along. When looking at it 
> this morning, I noticed in the class histogram that 
> [Ljava.util.concurrent.ForkJoinTask; appeared higher on the list than 
> I had expected.
>
> On the JVM that has 2 million client threads:
>
>  num     #instances         #bytes  class name (module)
> -------------------------------------------------------
>    1:       1999997     1453773944  jdk.internal.misc.StackChunk 
> (java.base at 16-internal)
>    2:          7169     1302840336 
> [Ljava.util.concurrent.ForkJoinTask; (java.base at 16-internal)
>
> On the JVM that has 2 million server threads:
>
>  num     #instances         #bytes  class name (module)
> -------------------------------------------------------
>    1:       2000000      820706112  jdk.internal.misc.StackChunk 
> (java.base at 16-internal)
>    2:       2000000      304000000  java.lang.VirtualThread 
> (java.base at 16-internal)
>    3:       2000000      208000000  java.lang.VirtualThread$1 
> (java.base at 16-internal)
>    4:       2000000      160000000  sun.nio.ch.NioSocketImpl 
> (java.base at 16-internal)
>    5:       1999999      143999928 
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask 
> (java.base at 16-internal)
>    6:            28      134230464 
> [Ljava.util.concurrent.ForkJoinTask; (java.base at 16-internal)
>
> Has anyone else noticed this?
Can you use `jmap -histo:live` to see if the "live" instance count is 
closer to what you expect?

-Alan.


More information about the loom-dev mailing list