Added stats logging to make it easier to tune the cache size.