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

Home » Public Forums » archive » Re: How to ensure arrays are de-allocated in IDL?
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
Re: How to ensure arrays are de-allocated in IDL? [message #72337] Sat, 28 August 2010 07:57
Jeremy Bailin is currently offline  Jeremy Bailin
Messages: 618
Registered: April 2008
Senior Member
On Aug 28, 8:59 am, Robin Wilson <ro...@rtwilson.com> wrote:
> Hi,
>
> I've written some code that processes a large number of files, and
> creates around 5 large arrays during the processing of each of these files.
>
> However, after I get to around 200 files the program crashes saying that
> it can't find enough memory to create the arrays.
>
> Do I need to do something specific to ensure the memory for the arrays
> used in previous iterations are de-allocated?
>
> Regards,
>
> Robin Wilson
> University of Southamptonwww.rtwilson.com

Are they just held by normal variables, or allocated with pointers or
in an object? If they're normal variables, then the memory should be
reclaimed when you re-assign the variable name (for example, in the
next iteration of the loop). You can force it to be reclaimed earlier
by making the variable undefined, using, for example, David's UNDEFINE
procedure (http://www.dfanning.com/documents/programs.html). If you're
allocating them with pointers, then you'll need to explicitly free
them with PTR_FREE, and with objects you'll need to destroy the object
with OBJ_DESTROY (although with the garbage collection in IDL 8, the
last case will become less relevant...).

-Jeremy.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: How to ensure arrays are de-allocated in IDL?
Next Topic: How to read first and last line of an ascii file FAST

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

Current Time: Wed Oct 08 17:37:15 PDT 2025

Total time taken to generate the page: 0.00452 seconds