Add memory limit in path formulation