Iterators.product OutOfMemoryError()

That’s exactly what Iterators.product already does. The problem is that you’re calling collect() which tries to collect that sequence into a vector. Just don’t do that:

ary_comb_n = Iterators.product(...)
2 Likes