corner case causes memory limit exceed