title: Java ForkJoinPool thread limit or Java stream alternative?
body: <p>I understand that java parallelStream(or ForkJoinPool) is designed to maximize CPU Utilization.
  Because of the great combination of java stream functional interfaces (such as map, reduce, filter) and ForkJoinPool I use java parallelstream and ForkJoinPool.</p>
  <p>The problem is that ForkJoin does not limit the number of active thread.
  If some threads blocked while it hold large memory, ForkJoinPool tries to create more threads to meet the parallelism(running thread).</p>
  <p>In this case cpu utilization will be maximized but heap memory will be Exhausted or even go OOM.</p>
  <p>How can I limit the number of active threads of ForkJoinPool?</p>
  <p>Or is there any java stream interface alternatives?</p>