When your service is stopped, the process is moved to the "cached" list and the OS will reclaim that memory when needed. You do not need to (and should not try to) manage that lifecycle yourself. If your service is re-started later and the process is still in the cached list, the OS is able to efficiently re-use the existing process.