- 
    Bug 
- 
    Resolution: Duplicate
- 
     P2 P2
- 
    None
- 
    8
- 
        b84
                    With b84 the following line leads to OOM (worked fine with b83):
Streams.generate(() -> "a").substream(1).parallel().iterator().next();
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
at java.util.stream.SpinedBuffer.ensureCapacity(SpinedBuffer.java:137)
at java.util.stream.Nodes$SpinedNodeBuilder.begin(Nodes.java:1204)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:393)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:384)
at java.util.stream.SliceOps$SliceTask.doLeaf(SliceOps.java:317)
at java.util.stream.SliceOps$SliceTask.doLeaf(SliceOps.java:266)
at java.util.stream.AbstractTask.compute(AbstractTask.java:287)
at java.util.concurrent.CountedCompleter.exec(CountedCompleter.java:710)
at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:260)
at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1012)
at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1631)
at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)
the following JCK tests fail with OOM on b84
api/java_util/Arrays/StreamOffsetLengthTests.html#StreamOffsetLengthTests[substream_skipSeveral_determinedOrder]
api/java_util/stream/Streams/ConcatInfinite.html#ConcatInfinite[substream_skipSeveral_determinedOrder]
api/java_util/stream/Streams/index.html#GenerateIntCycled[substream_skipSeveral_determinedOrder]
api/java_util/stream/Streams/index.html#GenerateLongCycled[substream_skipSeveral_determinedOrder]
api/java_util/stream/Streams/index.html#GenerateCycled[substream_skipSeveral_determinedOrder]
api/java_util/stream/Streams/index.html#GenerateRepeated[substream_skipSeveral_determinedOrder]
api/java_util/stream/Streams/index.html#GenerateDoubleCycled[substream_skipSeveral_determinedOrder]
api/java_util/stream/Streams/index.html#IterateStrings[substream_skipSeveral_determinedOrder]
api/java_util/stream/Streams/index.html#IterateIntegers[substream_skipSeveral_determinedOrder]
            
Streams.generate(() -> "a").substream(1).parallel().iterator().next();
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
at java.util.stream.SpinedBuffer.ensureCapacity(SpinedBuffer.java:137)
at java.util.stream.Nodes$SpinedNodeBuilder.begin(Nodes.java:1204)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:393)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:384)
at java.util.stream.SliceOps$SliceTask.doLeaf(SliceOps.java:317)
at java.util.stream.SliceOps$SliceTask.doLeaf(SliceOps.java:266)
at java.util.stream.AbstractTask.compute(AbstractTask.java:287)
at java.util.concurrent.CountedCompleter.exec(CountedCompleter.java:710)
at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:260)
at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1012)
at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1631)
at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)
the following JCK tests fail with OOM on b84
api/java_util/Arrays/StreamOffsetLengthTests.html#StreamOffsetLengthTests[substream_skipSeveral_determinedOrder]
api/java_util/stream/Streams/ConcatInfinite.html#ConcatInfinite[substream_skipSeveral_determinedOrder]
api/java_util/stream/Streams/index.html#GenerateIntCycled[substream_skipSeveral_determinedOrder]
api/java_util/stream/Streams/index.html#GenerateLongCycled[substream_skipSeveral_determinedOrder]
api/java_util/stream/Streams/index.html#GenerateCycled[substream_skipSeveral_determinedOrder]
api/java_util/stream/Streams/index.html#GenerateRepeated[substream_skipSeveral_determinedOrder]
api/java_util/stream/Streams/index.html#GenerateDoubleCycled[substream_skipSeveral_determinedOrder]
api/java_util/stream/Streams/index.html#IterateStrings[substream_skipSeveral_determinedOrder]
api/java_util/stream/Streams/index.html#IterateIntegers[substream_skipSeveral_determinedOrder]
- duplicates
- 
                    JDK-8012987 Optimizations for Stream.limit/substream -           
- Closed
 
-         
- relates to
- 
                    JDK-8012987 Optimizations for Stream.limit/substream -           
- Closed
 
-