Best practice to prevent robot crashes such as out of memory

This is a question in the Mock exam. The middle two choices appear incorrect. Choice “A-Add Clear Collection…” appears to be reasonable as a best practice, but I think that answer was marked wrong. That leaves choice “D-After every transaction…” Yes, it will work to prevent crashes, but it appears to be a very expensive way to achieve this, because of the added overhead for each transaction. What is the best practice? Thanks in advance for clarifying.

image