add an option to enable memory collection