# Screen error after 80 trials

**URL:** <https://psychtoolbox.discourse.group/t/screen-error-after-80-trials/4385>\
**Category:** Programming Help\
**Tags:** windows\
**Created:** [April 27, 2022, 4:44pm UTC](https://psychtoolbox.discourse.group/t/screen-error-after-80-trials/4385 "2022-04-27T16:44:13Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sblank](https://avatars.discourse-cdn.com/v4/letter/s/9fc29f/32.png) [@sblank](https://psychtoolbox.discourse.group/u/sblank)\
**Post date:** [April 27, 2022, 4:44pm UTC](https://psychtoolbox.discourse.group/t/screen-error-after-80-trials/4385/1 "2022-04-27T16:44:13Z")

</div>

I am trying to display a set of 40 images in 4 blocks (160 total images) with calibration between each block. When I run the code the way I have it for any combination of two blocks of 40 it works great, but if I try to loop through all 4 I get an error with Screen

textureIndex=Screen(‘MakeTexture’, WindowIndex, imageMatric [, optimizeForDrawAngle=0] [, specialFlags=0] [, floatprecision=0] [, textureOrientation=0] [, textureShader=0];

Error in script  
Stimtex(i)=Screen(‘MakeTexture", wp, imread9[imagedirectory,trial\_order{i,2},’.jpg’]))

Is there some reason that Psychtoolbox can’t handle displaying this many images? Again if I just loop through two blocks its fine

Matlab 2015a 32-bit  
Psychtoolbox 3.0.11  
Windows XP

---

<div class="post-metadata">

**Author:** ![dcnieho](https://avatars.discourse-cdn.com/v4/letter/d/779978/32.png) [@dcnieho](https://psychtoolbox.discourse.group/u/dcnieho)\
**Post date:** [April 27, 2022, 5:04pm UTC](https://psychtoolbox.discourse.group/t/screen-error-after-80-trials/4385/2 "2022-04-27T17:04:23Z")

</div>

There’s probably more error info higher up in the command window, post that

But first guess: do you close the texture that you make with maketexture after you no longer need it? You may be running out of memory
