Add `--memory-target` to manage memory usage (#1936)