Hyperloglog can be very useful for use cases where approx counts are ok. With very little memory, it allows counting with very high accuracy rates ( usually above 99%)
Java implementation available here under Apache 2.0 license.. https://github.com/aggregateknowledge/java-hll/ Himanshu
