Severe memory leak issue for all browsers, task crashes for the majority of participants

@YT_HAN Yes I see your point, great question, as it happens the PsychoJS that is served on Pavlovia may indeed include hotfixes as is the case with the slider bug you came across, x

I see, so I think those fixes are good. I was worried about changes like a different way of aligning text stim, but I assume those changes are not bugs and therefore will be included in a future release, rather than affecting the old versions?

OK let me ask our chief developer, apart from TextStim alignment what other changes are you worried about?

Thank you, I don’t have any particular concerns for now! The components that I use the most are text/slider/mouse/video(in another task), if there are anything that you guys plan to push changes to soon that would change the behaviors of those components a lot, it would be good to know. Otherwise, I suppose I should just keep an eye on the open issues here. https://github.com/psychopy/psychojs/issues

Alright, cool, FWIW we are in fact in the process of restructuring PsychoJS in ways that should hopefully address this type of problem, but it may take a while, thank you, x

1 Like

@sotiri Hello again. I have since done two pilot on Prolific (each recruits ~20 subjects). One is the rating stories as I described above, the other is almost equivalent, just replacing stories with videos. Using 2020.2.5, I had no report of technical issue for the story task, which is great. However, for the video one, I got a bunch of problems (14 completed successfully, but several had issues).

(1) there was an issue with import condition file, as someone else has also encountered, it only happened to 1 of my subjects, and he uses a rather old version of Firefox (66). I was just wondering if you think it’s only an issue for older browsers?

(2) two of my subjects report the button click didn’t work, both using chrome 86 on Mac. I am not sure what’s the problem, there are subjects with the same setting that finish just fine.

(3) three subjects have memory related issues I believe, using chrome 86 on linux/ chrome 86 on windows/firefox 82 on windows (again, I have ones with the same settings that finish just fine). they describe it as video just went blank and failed to load/having a glitch. I set the log file to be ERROR because setting it to be DEBUG generates really big log files, but still, any ideas why?

Hi @YT_HAN, huge thanks for another impressively meticulous report :blush: The input.matchAll error is indeed a browser compatibility issue, Firefox 67 onwards should be OK I believe.

Still looking for an answer to those memory leaks. All of the information you mention is very helpful, would you mind sharing a .psyexp for the video based project as well? Thank you, s.

Hi @sotiri, thanks for your answer to the matchall issue, I think most people use rather new versions of browsers so this shouldn’t be too much of a problem.

I have given developer access to you for 3 projects, ‘rating_story_set1’ is the old version for the stories; ‘rating_story_set1_test’ is the new version for the stories; ‘rating_video_set1_test’ is the new version for the videos. (I took down URL above as we are getting close to data collection). If you would like to run the task, just put happy as a scale. Let me know if any questions.

Right now, I am lost in terms of what to fix given that I do have successful responses and I couldn’t tell what went wrong for those that failed since others with the same setting can do the task. On subject using edge 86 on windows report to me that initially he clicked around and thought the screen was froze but then refreshes the screen and the task works all the way till the end.

Alright, cool, let me see if I can figure out what might have gone wrong. Thanks, s.

1 Like

https://github.com/psychopy/psychojs/issues/97 was the bug fix applied to all visual stim? Asking because text works, but not videos, just a thought.

Good catch, yes that tweak applies to all visual stimuli. I hear you that there are still issues with the movie component, but because other video playback weirdness went away when upgrading PIXI, I’m hopeful that may eventually help with the memory leaks as well.

I plan on spending most of tomorrow on this and will no doubt be posting back here as soon as I have a better understanding of where the problem lies, because I have been unable to reproduce on my development machine so far. Thanks again for your patience while I look for a solution, x

Hi @YT_HAN, I believe the issue you are having and is shared across all three projects is with the backspace preventing keydown event handler being attached to the document on each frame. That is 100% a memory leak risk factor. I have added an extra branch to your video study to demonstrate a possible fix plus the post PIXI upgrade tweaks required to get your movie components to run more reliably. Please let me know if those changes fail to solve the problem, x

hi @sotiri, Thanks so much for getting back to me so quickly.
In my tasks, I have the main rating part and then 8 trials for retest in the end where I also ask for a text input, so I used the backspace code to make sure backspace act as a delete key rather than taking people back to previous website as firefox do. Does the fix still achieve that purpose?
I can see your branch, but how do I run it?

No problem @YT_HAN, yes the only difference is that the keydown event handler is added only once, instead of on each frame, which as you can imagine leads to a stacking up of needless callbacks.

To run the fix you can accept a merge request I just created on GitLab or even edit your JS manually because the changes required are not that many. Please do let me know if you need more details, s.

thank you, I just tested and it all works fine (but things always work on my machine :sweat_smile:). I will try to contact the subjects who had memory issues to do it again and will report back.

I do want to ask if you have any insights for the 2nd problem that I mentioned before, that is, people report that the screen doesn’t respond when they click buttons (also encountered here). I can only reproduce the issue on my old Mac, using safari 12.1.2, and there were two people using chrome 86 on Mac who also experienced this. No error messages are shown, just nothing happened.

Sorry, yes, re: valid taps going undetected, very likely a side effect of how PsychoJS is wired to pick up mouse events on every animation frame. You could try adding actual HTML buttons, but I suspect it might be easier to advise your participants to only expect button-like components to fire against full clicks instead of just taps if that makes any sense, x

what you said makes sense, but I did click (not just tap) and the screen doesn’t respond

Hm, OK is that for all three projects?

when testing on my old Mac, yes, all three projects. So far it only happened to Mac users it seems (for the video one, but I only did 20 per study, so not sure about the other two), but many Mac users have no issues (for example, I have no issues with safari 13.1.2 on my new Mac).
I used a lot of mouse.getPressed()[0] === 1 to move on to next part of the task, would that be a problem?
Another unrelated question, if I make edits now in builder code components, and then sync, i would lose the edits you made, right? So do I then manually change the js file every time after I sync?

To answer your last question first, yes. About mouse clicks not firing I need investigate some more :nerd_face: