Java8 stream and parallel stream use ForkJoinPool.commonPool which is a general purpose pool (that theoretically keeps as many threads as CPUs there are on the machine) for short tasks...
I'm using some java8 features and i noticed that pool keeps only one thread and constantly kills and replaces it...

if I choose to see only live threads i'll have only one thread in the pool...

So the question is why does the pool replace the thread all the time? why not reuse it? Is this a normal behaviour? (if so, why?)
I don't think your deduction is correct. The pool has X number of threads. Let's say it starts with 5 threads. Now there will be 5 threads in IDLE state. If you hand it work, it will put 1 thread into ACTIVE state and then once the work is complete, it goes back to IDLE. If the pool is backed by a Queue, the thread pulled first is Thread0, then that goes to the back of the pool, the pool uses the other 4 threads and only then will Thread0 be used again. This is the pattern it is showing in your graph. Probably the reason you see only 1 thread live is that your work is so short that the Thread completes and goes back to IDLE before the next thread starts.
Edit
From the code: It creates a LIFO queue, with 1 thread if other properties/number of cores cannot be determined. Depending on how you startup your application, it might lead to some unexpected behavior, but cannot be sure of that since I have no idea about your system or application. The answer above is just explaining the way thread pools work and the pattern you showed in your first image can be understood based on this explanation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With