There is no theoretical limit. The BigInteger
class allocates as much memory as it needs for all the bits of data it is asked to hold.
There are, however, some practical limits, dictated by the memory available. And there are further technical limits, although you’re very unlikely to be affected: some methods assume that the bits are addressable by int
indexes, so things will start to break when you go above Integer.MAX_VALUE
bits.