inria.fr/flajolet/Publications/FlFuGaMe07.pdf
HLL is an improved version of LogLog that is capable of estimating the cardinality of a set with accuracy = 1.04/sqrt(m) where m = 2^b. So we can control accuracy vs space usage by increasing or decreasing b.
The main benefit of using HLL over LL is that it only requires 64% of the space that LL does to get the same accuracy.
This implementation implements a single counter. If a large (millions) number of counters are required you may want to refer to:
http://dsiutils.dsi.unimi.it/
It has a more complex implmentation of HLL that supports multiple counters in a single object, drastically reducing the java overhead from creating a large number of objects.
This implementation leveraged a javascript implementation that Yammer has been working on:
https://github.com/yammer/probablyjs