correct mem calc