URL of experiment: defcon_builder [PsychoPy]
Description of the problem:
Hi!
There is a build up in memory usage over the course of my experiment until at some point the experiment starts to lag and later on the tab of the browser crashes. I guess that’s what they call a memory leak?
OS: Ubuntu 18.04
**PsychoPy version: 2020.2.2
**Standard Standalone?: no (Anaconda environment)
** Browser: Firefox 79.0
I’m using the Builder with code components written in JS. In each trial of the experiment there are 409 visual elements (visual.Polygon or visual.Rect) presented on the screen (via setAutoDraw). There is one dictionary and two arrays that grow over the course of the experiment (one additional entry (float) per trial).
Since every single element is logged, the log file accumulates to a size of up to 300 MB (with approximately 2 million lines) after around 1000 trials. Might the accumulation of log entries cause a visible increase of RAM usage over time?
I already tried to switch off the log messages (by commenting out lines in core-2020.2.js) but the memory usage still increases over trials. Is there a function to properly switch off the log file or change the logging level in an online experiment?
I also tried to replace some of the visual elements (~273 of the 409 in total) by using images instead but the build up in memory usage still consists (smaller but still there). Additionally this compromise comes with the cost of downloading a lot of stuff at the start of the experiment wich is inconvenient for the participants.
I wrote the memory usage during the experiment to a file (with all the measures described above already implemented). This is what it looks like as a plot:
Do you have any idea where the increase in memory usage might come from?
Do you know any approach to use for debugging in such a case?