The simplest way, as I understand your question, is just to call finish()
on those Activities
which you don't want to keep. This will destroy them, removing them from the stack and from memory.
However, I wouldn't worry so much about memory here as I would worry about your user's experiences. Don't remove these Activties
simply for the purpose of conserving memory. Do it because they aren't needed and when the user presses the "Back" button they don't expect to see them.