'keep-alive-seconds' defined in configuration is deprecated some time ago and it is not used anymore. Thread-pool 'keepAliveTime' is configured to 60 seconds (third parameter in ThreadPoolExecutor constructor). And 'core-pool-size' is zero (0). So, after 60 seconds idle time, all threads will be terminated. In 60 seconds period, alive and idle threads will be re-used.
'allowCoreThreadTimeOut' is introduced in Java 6, Hazelcast can not use that because it is Java 5 compatible. But also Hazelcast does not need that, because it is meaningful for thread-pools those have some core threads. Hazelcast's core thread count is zero. 'keepAliveTime' applies to all threads.
By using test below this behavior can be seen;
----------------------------------------------------------------------------------------------------------------------------------------
public static void main(String[] args) throws Exception {
ExecutorService ex = Hazelcast.newHazelcastInstance(null).getExecutorService();
for (int i = 0; i < 20; i++) {
ex.execute(new DummyTask());
}
Thread.sleep(1000);
com.hazelcast.impl.management.ThreadDumpGenerator tdg = com.hazelcast.impl.management.ThreadDumpGenerator.newInstance();
System.out.println(tdg.dumpAllThreads());
Thread.sleep(1000 * 70); // make sure all idle terminated
System.out.println(tdg.dumpAllThreads());
}
static class DummyTask implements Runnable, Serializable {
public void run() {
try {
Thread.sleep(5 * 1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
In the first dump there will be 20 threads named 'hz._hzInstance_1_dev.cached.thread-1' to 'hz._hzInstance_1_dev.cached.thread-20'.
In the second dump you should not see those threads (there may be one that not terminated because of Hazelcast internal tasks).
@mmdogan