I am trying to learn about heapdumps and threaddumps and in doing that created a very simple application which is using completable future :
public static void main(String[] args) throws InterruptedException {
for (int i = 0; i < 40; i++) {
CompletableFuture.runAsync(() -> {
System.out.println(Thread.currentThread().getName());
// service.perform();
}).join();
}
}
I have also added a system property "-Djava.util.concurrent.ForkJoinPool.common.parallelism=1" so that it will create thread per task and it is doing that, but when monitoring it through visualvm i am not able to see these threads :
How to know the lifecycle of those threads created by forkjoinpool ? and how to see all threads info.?