Out of memory error - Builder 2026.2.4

Hi again from me,

Thanks @graceevans and @JensBoelte for your replies!
I tried changing a few things relating to the window and text display but the issue appeared to be unrelated… Also, any path inconsistencies were due to me miscopying/mispasting, so that didn’t explain the issue either… The weirdest part was that while the experiment worked fine on my laptop, it didn’t on the lab-based one…
After looking at the logs, I noticed a slightly different problem relating to the sound components, which may or may not be related to the out-of-memory error…

Specifically, to force the end of each routine, I was using a sound duration-based check following a similar logic as in a previous post ( Audio end doesn't end routine - Builder v 2026.2.4 - #2 by stanley1O1 ). So I had this code bit in the Each frame tab of the audio_routine_2 (similar for audio_routine_1)

if sound_resource_2.status == STARTED and (t - sound_resource_2.tStart) >= sound_resource_2_dur:
    continueRoutine = False

But if the sound’s status was already set to FINISHED before this code bit ran, the condition could never be true, so the routine would never end.

I logged which check fired first (i.e. sound.status == FINISHED or the custom duration based one), over 24 trials on each laptop and I saw that:
On my laptop (sounddevice backend, with wav audio files played at 44100 Hz, matching their sample rate): the status was never FINISHED early, 0 of 24.
Lab laptop (PTB backend, 48000 Hz, files resampled): the status was already FINISHED in 2 of 24 trials. Each of those would hung.

So it seems to be related to which one of the two ways of detecting the end of the sound fires first, and the backend decides which one wins perhaps?

In any case, (I think) I now managed to solve the issue by using the code below to end routines, though I’ll need to do a few more check before launching the exp

if sound_resource_2.status == FINISHED or ( sound_resource_2.status == STARTED and (t - sound_resource_2.tStart) >= sound_resource_2_dur ):
....