Records are kept forever in the unique dict. In most cases this is not a problem, but I think naive uses (like logging strings coming from external sources directly) will cause an unexpected (and hard to track) memory bloat.

I think a simple form of LRU must be used here, and throw away old remnants after a certain period/number of records.