-
Bug
-
Resolution: Done
-
Major
-
13.0.1.Final
-
None
When a collector is used, the distributed streams behave as if the result is "reduced", expecting the collector result to be comparable in size to a cache value.
Most collectors do not reduce the value size at all, e.g. stream.collect(CacheCollectors.serializableCollector(() -> Collectors.toList())), then all the values on a remote node are collected into a single list and marshalled into a single byte array/JGroups message.
The creation of the byte array is likely to fail with an OutOfMemoryError, but if the total size is > 2GB and there is enough free heap memory, an overflow bug in BytesObjectOutput.ensureCapacity() turns the OOME into an ArrayIndexOutOfBoundsException.