offScreen putimage not enough memory: need help!!

Hello,
I "putimage" offscreen to load 42 images each size of which is
rather big (1400X1400). I do it by looping the next commands:
for loop=1:42
figName = strcat('stFig', num2str(loop));
load (figName, 'zInputL')

windowOffLtemp =
Screen(screenNumberL,'OpenOffscreenWindow');

Screen(windowOffLtemp,'PutImage',incL*zInputL,[posHL1,posVL
1,posHL2,posVL2]);

end

Now when it reaches to 32 figures loaded offscreen, I get this
error message.
"??? ScreenPutImage.c: not enough Matlab (118 MB) or Temp
(280 MB) memory for new 1400 x 1400 x 32 bit offscreen window.
(You can use BYTES to check.)"

But I have to have these 42 figures of this size loaded before the
rest of the algorithm.
What can I do to increase the memory size? Or any other
solutions?
Matlab has 1Gb minimum, 1.2Gb maximum moemory allocated.
My machine is G4 desktop, 733MHz, 1.5Gb memroy installed.

If anyone know the solution, please let me know.
one thing that obviously is going wrong is that you are opening every offscreenwindow
under the same name, so even if you would be able to load all of your images, you would
not be able to copy them (only the last one).

here some more:

use clear all at the beginning of your script to clear any stuff in memory

Change your loop to:

for loop=1:42
figName = strcat('stFig', num2str(loop));
load (figName, 'zInputL')
windowOffLtemp(loop) = Screen(screenNumberL,'OpenOffscreenWindow');
Screen(windowOffLtemp(loop),'PutImage',incL*zInputL,[posHL1,posVL1,posHL2,posVL2]);
end

Make sure you use Screen('closeall') at the end of your program.

with 1 Gb of memory, you should have enough memory.
However, an obvious means to reduce your memory needs is to work in 8-bit mode, rather
then 32 bit mode.

gr.
frans





--- In psychtoolbox@yahoogroups.com, "nokdokdada" <nokdokdada@y...> wrote:
> Hello,
> I "putimage" offscreen to load 42 images each size of which is
> rather big (1400X1400). I do it by looping the next commands:
> for loop=1:42
> figName = strcat('stFig', num2str(loop));
> load (figName, 'zInputL')
>
> windowOffLtemp =
> Screen(screenNumberL,'OpenOffscreenWindow');
>
> Screen(windowOffLtemp,'PutImage',incL*zInputL,[posHL1,posVL
> 1,posHL2,posVL2]);
>
> end
>
> Now when it reaches to 32 figures loaded offscreen, I get this
> error message.
> "??? ScreenPutImage.c: not enough Matlab (118 MB) or Temp
> (280 MB) memory for new 1400 x 1400 x 32 bit offscreen window.
> (You can use BYTES to check.)"
>
> But I have to have these 42 figures of this size loaded before the
> rest of the algorithm.
> What can I do to increase the memory size? Or any other
> solutions?
> Matlab has 1Gb minimum, 1.2Gb maximum moemory allocated.
> My machine is G4 desktop, 733MHz, 1.5Gb memroy installed.
>
> If anyone know the solution, please let me know.
Frans,
Thanks for the comments. But I had done all of those. The algorithm I
wrote to my original message was a simplified version and I did not
include the individual naming (which I should have). So, after running
my real algorithm, it creates 32 offscreen images, but no more.
Any idea?

--- In psychtoolbox@yahoogroups.com, "franswcornelissen"
<f.w.cornelissen@m...> wrote:
>
> one thing that obviously is going wrong is that you are opening
every offscreenwindow
> under the same name, so even if you would be able to load all of
your images, you would
> not be able to copy them (only the last one).
>
> here some more:
>
> use clear all at the beginning of your script to clear any stuff in
memory
>
> Change your loop to:
>
> for loop=1:42
> figName = strcat('stFig', num2str(loop));
> load (figName, 'zInputL')
> windowOffLtemp(loop) = Screen(screenNumberL,'OpenOffscreenWindow');
>
Screen(windowOffLtemp(loop),'PutImage',incL*zInputL,[posHL1,posVL1,posHL2,posVL2]);
> end
>
> Make sure you use Screen('closeall') at the end of your program.
>
> with 1 Gb of memory, you should have enough memory.
> However, an obvious means to reduce your memory needs is to work in
8-bit mode, rather
> then 32 bit mode.
>
> gr.
> frans
>