check for cache size for memoized functions