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: to make array for panchromatic file
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: Unable to allocate memory: to make array for panchromatic file [message #89181 is a reply to message #89180] Thu, 31 July 2014 01:07 Go to previous messageGo to previous message
Fabzi is currently offline  Fabzi
Messages: 305
Registered: July 2010
Senior Member
Hi,

On 31.07.2014 09:40, phamlien24@gmail.com wrote:
> % Unable to allocate memory: to make array.
> Not enough space

try to "clean" your code.

Avoid declaring too many variables and either reassign the ones that are
not used anymore and pollute your memory or make use of temporary()

For example, this is bad:
IDL> ones = fltarr(5000,5000) + 1
IDL> twos = ones + 1

After these two statements you'll have two large arrays in memory even
if "ones" is not needed anymore. Two alternatives:

; Reassign
IDL> twos = fltarr(5000,5000) + 1
IDL> twos = twos + 1

; Temporary
IDL> ones = fltarr(5000,5000) + 1
IDL> twos = temporary(ones) + 1

To take an example of your code:

br=fltarr(ns,1,nl)
br = (pan *(K_pan)/(Pan_Width))*0.1

The first assignment is useless and memory expensive. Since IDL is
dynamically typed, there is absolutely no need to declare the variable
"br" since it will be overwritten on the next line.

Cheers,

Fabien
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Any alternatives of "circle" ('o') symbol using New Graphics?
Next Topic: Ellipse in (lon, lat)

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

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

Total time taken to generate the page: 1.04136 seconds