Memory overloading
Hi everyone,
I'm experiencing Opensesame crashes which I think are related to memory overload.
The experiment features heavy use of videos, which I assume are the culprit. Unfortunately, these are essential to the experiment.
I've done a bit of troubleshooting, and there are a few things that I've found that seem counterintuitive to me, and on which I hope some more experienced users can help shed some light.
The file pool is rather large (33,6 MB), as it includes the above-mentioned videos. However, these videos have been downsized from an earlier version of 251 MB, and this has made no difference in the point at which the experiment crashes. In either case, the experiment crashes after around 18 trials, regardless of the size of the video stimuli.
Looking at memory usage, this seems to increase steadily from the start of the experiment until it crashes (see image). I've tried to remedy this constant increase in memory usage by diligently collecting garbage at the start of every trial with the gc.collect()
command. This seems to have no effect on the steady increase of used memory, nor on the amount of trials before the system crashes. (I may, of course, just be using this function incorrectly).
A final note: the computer on which I am designing/running the experiment seems to at least be part of the problem. I am using a Dell latitude 3380 running Windows 10 (64bit version), and testing the experiment on a colleagues thinkpad results in smooth running and no crashes at all. I do hope that there is a way to make the experiment itself run better/more efficient, so that it can be used to test on more hardware platforms.
I've uploaded the experiment and the stimuli used in the following dropbox folder, in case anyone wants to have a look.
https://www.dropbox.com/sh/zbctqc7b5rezko3/AABA1pscS6qS851TTl9j-fOCa?dl=0
Many thanks for any suggestions on how to address this problem in advance.
Regards,
Elef
Comments
Update: it seems to be very dependent on the backend. I was using PsychoPy before, but legacy seems to run really smooth with no problems. Using the legacy backend instead seems a viable solution should all else fail
Hi Elef,
I hope you're doing well in Genoa! (I'm assuming you're there now?)
This crash is due to a memory error in PyGlet, which is a library used by PsychoPy. The error is not due to memory filling up per se, although it's possible that this increases the risk of the error occurring. As far as I know, the exact cause of the error is unknown, and there's no solution. (It's certainly not something that you're doing wrong!)
One thing that you could try is getting the latest version of OpenSesame (if you don't have that already) and/ or updating PyGlet and PyOpenGL through the Python package manager in OpenSesame.
And, as you already noticed, switching to the legacy backend will make the problem disappear, because legacy doesn't use PyGlet.
Cheers,
Sebastiaan
Check out SigmundAI.eu for our OpenSesame AI assistant!
Hey Sebastiaan!
Thanks a lot! I guess I was looking for the problem in a completely unrelated direction, this definitely saves me a lot of time.
And thank you for the best wishes, things are good at the istituto italiano di tecnologia. OpenSesame is quite popular in our lab (see this publication from earlier this month https://www.ncbi.nlm.nih.gov/pmc/articles/PMC5807394/). We're looking forward to using it in conjunction with embodied robots soon.