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

Home » Public Forums » archive » How to delete a variable
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
How to delete a variable [message #88382] Fri, 18 April 2014 12:29 Go to previous message
wlandsman is currently offline  wlandsman
Messages: 743
Registered: June 2000
Senior Member
There are times when one wants to delete variables inside a program to save memory. (The intrinsic DELVAR command can only be called at the main level.) For example, the Coyote program UNDEFINE ( http://www.idlcoyote.com/programs/undefine.pro ) tests whether a variable is a pointer, object, structure or ordinary variable, and will apply HEAP_FREE, OBJ_DESTROY, iteration, or set an ordinary variable to 0.

I was using a more elegant but apparently less reliable solution in delvarx.pro
http://idlastro.gsfc.nasa.gov/ftp/pro/misc/delvarx.pro

in which the single statement

Heap_Free, PTR_NEW(x , /No_Copy)

would release the memory and destroy any type of IDL variable x. But I have gotten reports that in some cases this can be terribly slow. Actually the two reports have both been on CentOS Linux systems running IDL 7.0, so perhaps this is a problem fixed in more recent versions of IDL. But can anyone think of a reason why the above statement is not good way to release memory?

Thanks, --Wayne
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: colorbar
Next Topic: Upload a file on a website

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

Current Time: Wed Oct 08 16:21:56 PDT 2025

Total time taken to generate the page: 0.00420 seconds