Android experiment - [Errno 24] Too many open files
Hi,
I have a loop with 24 trials. My droid experiment keeps crashing after something like 20 trials. Here is the error :
IOError: [Errno 24] Too many open files: u'/data/data/nl.cogsci.opensesame/files/tmpK_9ATe.opensesame_pool/ta_14.png'
I found these related topics : topic 1 topic 2 but i counldn't find a solution.
In my experiment i have many audio and image files. I'm strictly using inline_scripts (canvas.image() and sampler() functions) to display the images and play the sound files.
Is there a way to close an image after using it with canvas.image() ?
Comments
Hi Pad,
I suspect that this may have to do with automatic garbage collection, which is disabled by default. Instead, garbage (i.e. unused objects) is collected forcibly after every
sequence. But if you do everything in one longinline_script, this may result in memory not being freed at all (and perhaps files not being closed, I'm not sure).What happens if you untick the 'Disable garbage collection' box in the General Properties tab?
Cheers,
Sebastiaan
Check out SigmundAI.eu for our OpenSesame AI assistant!
Hi,
Just went back to this project,
Unticking this box doesn't fix the problem
Could you upload the experiment? In principle, the image files should be closed automatically when they are no longer used. But if I look at the script, perhaps I can find a reason why this doesn't happen.
It's also possible that this is really a bug in the (unmaintained)
pgs4a, which is the library that the Android runtime is based on. If that's the case, there's not much that can be done about it.Check out SigmundAI.eu for our OpenSesame AI assistant!