The number of individual streams, and thus products, is limited to Int.MaxValue.
The groupBy operator holds the references to these streams in memory, opening a possible out of memory issue here.
As the first problem is also related to the usage of groupBy, we may say that we only have one problem: the usage of groupBy.
For a limited amount of data, the proposed solution is perfectly fine. We will discuss an alternate approach in the upcoming chapters.
Back