finished: #2 support memory limit check