Search code examples
jvmhazelcastdistributed-caching

Hazelcast is using high number of JVM threads


I am using hazelcast in JVM in my application which is running 2 replicas in kubernetes. Hazelcast in both comtainers has formed a cluster and sync is working perfectly fine.

But my application has started using 20% more threads after starting to using hazelcast. On aanalyzing thread dump it is found that hazelcast is using that extra 20%

enter image description here

Is it okay for hazelcast to use this many number of threads or if this can be reduced, how can I go about this?


Solution

  • Hazelcast will self-size the number of threads it uses, based on the number of processors available to it.

    (In Java, see Runtime.availableProcessors() )

    How many does your container have allocated ?

    You can override the threading if you are sure it's inappropriate. Look for system properties like hazelcast.*.thread.count from here. There are many options and it's not a casual task just to reduce or increase, If you tune numbers down, you risk performance being very poor.