Details
-
Sub-task
-
Resolution: Fixed
-
P3
-
8
-
b115
Description
Some intermediate operations are barriers, such as limit, distinct and sorted.
Some stream sources are large or infinite, such as ThreadLocalRandom.current().ints(), Stream.iterate and Stream.generate.
When such stream sources are hooked up to such intermediate ops in a parallel pipeline OOMEs can occur. (Note that sorted is a barrier for parallel and sequential pipelines.)
We need to document, using @implNotes where appropriate, such limitations and cases where performance may be reduced
--
flatMap operates sequentially on the mapping of E to a Stream<E'>. If the mapping results in 1:N where N is large and varies then the computation tree may be unbalanced
Some stream sources are large or infinite, such as ThreadLocalRandom.current().ints(), Stream.iterate and Stream.generate.
When such stream sources are hooked up to such intermediate ops in a parallel pipeline OOMEs can occur. (Note that sorted is a barrier for parallel and sequential pipelines.)
We need to document, using @implNotes where appropriate, such limitations and cases where performance may be reduced
--
flatMap operates sequentially on the mapping of E to a Stream<E'>. If the mapping results in 1:N where N is large and varies then the computation tree may be unbalanced
Attachments
Issue Links
- relates to
-
JDK-8014907 Infinite looping: ThreadLocalRandom.current().doubles().parallel().distinct().iterator().next()
- Resolved
-
JDK-8021578 XStream.iterate("abc", obj -> obj).substream(n).parallel().iterator().next() leads to OOM
- Resolved