limit memory use by clearing cache