fix work_mem calc