initialized default mem_max to -1