need to set a hard limit for size of samples that can be cached in memory