comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Memory problem
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Memory problem [message #58757 is a reply to message #3153] Thu, 14 February 2008 10:32 Go to previous message
Jean H. is currently offline  Jean H.
Messages: 472
Registered: July 2006
Senior Member
jujo@argentina.com wrote:
> Hi!
> I'm trying to make a very large array:
>
> a=fltarr(5287, 7707, 8)
>
> Then I got the warning: 'Unable to allocate memory: to make array.'
>
> Is there any way to avoid this message?
>
> Best!
> Jurandir

yes, you can buy more memory and/or switch to linux.

Under Windows, you can have, by definition, at most 2Gb of ram per
process (3Gb indeed, if you trick your system... have anybody tried it
with IDL 7??), while under linux, you have no limit.

Now, IDL always need contiguous memory space to create an array. Under
windows, the operating system uses some small amount of memory located
anywhere, so you can never have more than +- 1.2Gb of contiguous memory.
Under Linux, the operating system uses the beginning of the memory
space, allowing much bigger arrays to be created.

You array is about 1.2 Gb. You can create an array of 8 pointers, each
pointing to a 5287 * 7707 array, which are about 155 Mb.

Another option is to cut down your array in two or more. For example,
you create arrays of a maximum size of 500 * 500 * 7 (whatever), and you
create multiple arrays to contains all your data. Like that, you can
save and restore some arrays to your disk (and therefore free some memory)!

Have a look at the program memtest made by ittvis. It will tell you the
size of the 10 biggest array you can make. I have made a modified
version (search in this newsgroup for "availablememory" or under my name
(jean H) to find it. I use it often to 1) assess the max available
memory, 2) take out the memory that I will need to process my array, 3)
create 1 array of the max possible size, fill it, save it to disk,
remove from memory, 4) create another array etc, 5) restore the first
array, process it, delete it, 6) restore the 2nd array, process it etc.

Good luck with that!
Jean
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: How to draw legend in draw widget
Next Topic: image statistics without the NaN

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 08:16:27 PDT 2025

Total time taken to generate the page: 0.56525 seconds