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

Home » Public Forums » archive » Unable to allocate memory
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Unable to allocate memory [message #73567] Fri, 19 November 2010 06:47 Go to next message
Haje Korth is currently offline  Haje Korth
Messages: 651
Registered: May 1997
Senior Member
The message "unable to allocate memory" has become a frequent visitor
in my console output on IDL 8.0.1 for Windows. Highly frustrating...
Re: unable to allocate memory [message #80201 is a reply to message #73567] Tue, 22 May 2012 17:10 Go to previous messageGo to next message
Russell Ryan is currently offline  Russell Ryan
Messages: 122
Registered: May 2012
Senior Member
On May 22, 8:33 am, greg.a...@googlemail.com wrote:
> Insert a line:
>
>   ec3=0
>
> just before the problem line

This is because you don't have enough memory (RAM) on your computer to
do this. Roughly speaking a 10k x 10k image is around 0.5 Gb.
You're loading a 1k x 1k x 300 image into memory (which is roughly 3
10k x 10k images in size), then you're allocating two more variables
that is equal in size. Then you need at least ~4.5 Gb of memory.

Do you really need all that data in memory? I'm an astronomer, and it
looks like you're reading a dark image and a bunch of images
(presumably to reduce). If so, then let me suggest you work on each
image in serial. So read the calib files (darks, flats, biases,
etc.). Then load image 1, do the processing on that image, write it
out, goto next image.

Russell
Re: unable to allocate memory [message #80216 is a reply to message #73567] Tue, 22 May 2012 05:33 Go to previous messageGo to next message
greg.addr is currently offline  greg.addr
Messages: 160
Registered: May 2007
Senior Member
Insert a line:

ec3=0

just before the problem line
Re: Unable to allocate memory [message #85806 is a reply to message #73567] Tue, 10 September 2013 13:43 Go to previous message
sivan is currently offline  sivan
Messages: 13
Registered: August 2012
Junior Member
Thanks for the information.
I have missed the point.

On Tuesday, September 10, 2013 11:02:01 PM UTC+3, suicida...@gmail.com wrote:
> On Tuesday, September 10, 2013 1:57:48 PM UTC-6, sivan wrote:
>
>> Hi all,
>
>>
>
>>
>
>>
>
>> I know there are plenty of topics corresponding to this problem but I did not find a clear answer.
>
>>
>
>> I wrote:
>
>>
>
>>
>
>>
>
>> IDL> logage=dblarr(1259200)
>
>>
>
>> IDL> number=91
>
>>
>
>> IDL> ologlum=9.0d*(findgen(number))/(number-1)-3
>
>>
>
>> IDL> loglm=dblarr(1259200)
>
>>
>
>> IDL> likelihood=dblarr(1259200)
>
>>
>
>> IDL> g1=transpose(ologlum##replicate(1d,n_elements(logage)))
>
>>
>
>> IDL> g2=loglm#replicate(1d,n_elements(logage))
>
>>
>
>> % Unable to allocate memory: to make array.
>
>>
>
>> Cannot allocate memory
>
>>
>
>> % Execution halted at: $MAIN$
>
>>
>
>>
>
>>
>
>> I also tried these:
>
>>
>
>>
>
>>
>
>> IDL> g1=transpose(temporary(ologlum)##temporary(replicate(1d,n_el ements(logage))))
>
>>
>
>> IDL> g2=temporary(loglm)#temporary(replicate(1d,n_elements(logage )))
>
>>
>
>> % Unable to allocate memory: to make array.
>
>>
>
>> Cannot allocate memory
>
>>
>
>> % Execution halted at: $MAIN$
>
>>
>
>>
>
>>
>
>> It doesn't change anything.
>
>>
>
>>
>
>>
>
>> I use Ubuntu 12.04.03 (amd64), 8GB RAM and IDL 7.1.1.
>
>>
>
>>
>
>>
>
>> I hope there is a solution to this problem.
>
>>
>
>> Thanks in advice,
>
>>
>
>> Sivan.
>
>
>
> The error message is pretty self-explanitory...you don't have enough memory.
>
>
>
> "#" performs a matrix multiplication. The number of elements in the result is the product of the number of elements in the inputs. Your g2=loglm#replicate(1d,n_elements(logage)) command would result in a 1259200x1259200 = 1585584640000 element array as the output. At double precision (8 bytes per element), that would require nearly 12 TB (yes, terabytes) of RAM to hold.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Unable to allocate memory
Next Topic: LABEL_REGION on large array --> segmentation fault, please HELP !!

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

Current Time: Wed Oct 08 15:15:38 PDT 2025

Total time taken to generate the page: 0.00417 seconds