Fixed cleaning of caches to only do when the memory gets really high.