Hi PsychoPy-Community!
I have an experiment that I am trying to run in our labs. The experiment has a very high number of trials, as two routines (stimulus presentation and response, Feedback) are repeated over and over again.
After the experiment crashed with the first participants shortly before the end of the experiment (no error message, computer shuts down completely), I noticed the following:
While in other of my PsychoPy experiments the working memory increases by a maximum of 0.02 MB per trial, the working memory in this experiment increases by 4-6 MB.
However, the experiment does not consist of much code and all I use in the code are lists. Does anyone have experience with lists that are updated from trial to trial? I have rebuilt the experiment from scratch several times and am now at the point of saying that the problem can only be the updating lists from trial to trial (which nevertheless should not take up so much working memory capacity…?).
In each trial, I present a stimulus, the participants presses a key corresponding to the stimulus, and I give feedback for that response.
This is the code I am using:
###Stims
stimList=["A","B","C","1","2","3"]
shuffle(stimList)
###Targets
if trialsTr.thisN < 2:
Sn = stimList.pop(0)
while Sn in prevList:
shuffle(stimList)
Sn = stimList[0]
Snot = stimList.pop(1)
if Sn == "A":
Snot = "1"
if Sn == "1":
Snot = "A"
if Sn == "2":
Snot = "B"
if Sn == "B":
Snot = "2"
if Sn == "3":
Snot = "C"
if Sn == "C":
Snot = "3"
prevList.append(Sn)
prevList.append(Snot)
if trialsTr.thisN == 2:
prevList.pop(1)
Sn = stimList.pop(0)
while Sn in prevList:
shuffle(stimList)
Sn = stimList[0]
Snot = stimList.pop(1)
if Sn == "A":
Snot ="1"
if Sn == "1":
Snot = "A"
if Sn == "2":
Snot = "B"
if Sn == "B":
Snot = "2"
if Sn == "3":
Snot = "C"
if Sn == "C":
Snot = "3"
prevList.append(Sn)
prevList.append(Snot)
if trialsTr.thisN > 2:
print(prevList)
prevList.pop(0)
prevList.pop(1)
print(prevList)
Sn = stimList.pop(0)
while Sn in prevList:
shuffle(stimList)
Sn = stimList[0]
Snot = stimList.pop(1)
if Sn == "A":
Snot ="1"
if Sn == "1":
Snot ="A"
if Sn == "2":
Snot ="B"
if Sn == "B":
Snot ="2"
if Sn == "3":
Snot ="C"
if Sn == "C":
Snot ="3"
prevList.append(Sn)
prevList.append(Snot)
print(prevList)
If anyone has had similar experiences or knows what the problem could be - thank you in advance!