refactor memory limits