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

Home » Public Forums » archive » Re: yet another idl memory question
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: yet another idl memory question [message #66789 is a reply to message #66689] Mon, 08 June 2009 11:22 Go to previous message
pgrigis is currently offline  pgrigis
Messages: 436
Registered: September 2007
Senior Member
On Jun 4, 1:06 pm, David Fanning <n...@dfanning.com> wrote:
> Jean H. writes:
>> in which case you may want to save the
>> variable(s) to a file, free the memory (data=0B) and start processing
>> the next file.
>
> Of course, data=0B doesn't free *all* the memory,
> and doing this many times leads, I suspect, to the memory
> fragmentation that is the heart of the problem. I suggest
> you use UNDEFINE. That really does release *all* the memory
> associated with a variable.

Really? Certainly it's not a substitute for ptr_free, is it?
At least not in my system:

help,/mem
;heap memory used: 924074, max: 1972734, gets: 574,
frees: 135

;create pointer
a=ptr_new(bytarr(2LL^28))
help,/mem
;heap memory used: 269360586, max: 269360761, gets: 582,
frees: 140

.comp ~/undefine.pro ;makes sure I am using DF's undefine
;% Compiled module: UNDEFINE.
undefine,a

help,a
;A UNDEFINED = <Undefined>

help,/mem
;heap memory used: 269362262, max: 270427272, gets: 613,
frees: 164

heap_gc
help,/mem
;heap memory used: 926762, max: 269362382, gets: 624,
frees: 174

Ciao,
Paolo


> And it elegantly indicates
> what the code is actually doing, too, a significant
> advantage for people reading your code after you have
> run off to the tropics with that hot financial analyst
> over in the head shed. :-)
>
>   http://www.dfanning.com/programs/undefine.pro
>
> Cheers,
>
> David
>
> --
> David Fanning, Ph.D.
> Coyote's Guide to IDL Programming (www.dfanning.com)
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Saving Current Graphics Window in TIFF
Next Topic: Distributing code in IDL 7.1

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

Current Time: Thu Oct 09 20:55:45 PDT 2025

Total time taken to generate the page: 1.52116 seconds