How to delete the image stimulus from memory after it has been presented

Hi!

I’m trying to design an experiment in which I present a sequence of images every 5-60 frames and the subject has to respond via key press in order to move a slider.
The problem is that sometimes the slider doesn’t move as soon as the key is pressed, and it needs to be repeatedly pressed for a response to be registered. I assume this might be a memory issue, since I have quite a few if statements in the “every frame” part of my code component. Also, there are about 400 images presented per 2-minute block which is quite memory heavy.

Aside from simplifying my code in “each frame”, is there anything else I could do to prevent memory issues?

Is there any way to delete the image stimulus after it has been presented?

Thank you!

Hello MRascu

do you mind posting the relevant code here?

Best wishes Jens