Set maxed cached memory to not go beyond max direct memory.