[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: about memory

Hong Gang wrote:
> The following is the error given by my program.
>       % Unable to allocate memory: to make array.
>       Cannot allocate memory
> I have some large arrays as Tb(632*664, 880).  I do not know what is the
> matter with the program.   Can anyone give me some idea?

Usually this means that IDL has run out of memory. An array of dimensions
419648 (632*664) by 880 would have 369290240 elements. If it is of type
FLOAT, then each element takes up 4 bytes, coming to a grand total of
almost 1.4 Gigabyte. Do you have that much memory?

It might be possible to increase the amount of virtual memory (= swap space
on disk) available, but swapping memory from disk invariably slows down
programs quite a lot. A much better approach would be to rewrite your program
so that it needs less memory, e.g. by processing the data in smaller blocks.

hope this helps,