Java's BitSet
is in memory and it has no compression in it.
Say I have 1 billion entries in bit map - 125 MB is occupied in memory. Say I have to do AND and OR operation on 10 such bit maps it is taking 1250 MB or 1.3 GB memory, which is unacceptable. How to do fast operations on such bit maps without holding them uncompressed in memory?
I do not know the distribution of the bit in the bit-set.
I have also looked at JavaEWAH, which is a variant of the Java BitSet
class, using run-length encoding (RLE) compression.
Is there any better solution ?