Use a load factor to determine if we should clean up the cache.

Previously, the cache was cleaned up with an implicit load factor of 1.