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

Home » Public Forums » archive » Re: Releasing memory in IDL
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: Releasing memory in IDL [message #58225 is a reply to message #58224] Wed, 23 January 2008 12:35 Go to previous messageGo to previous message
Jean H. is currently offline  Jean H.
Messages: 472
Registered: July 2006
Senior Member
Jaime wrote:
> Thanks Jean,
>
> it helped me... but I was forced to call heap_gc and delete a couple
> of arrays (a=0) at the end, but still inside, of the clumpfind
> function. After that I still needed to call heap_gc after clumpfind is
> called.
>
> It looks still strange to me that I should all this to get some memory
> back... is there a way to avoid the memory leak?
>
> Best,
> Jaime

hum...
for regular variables (i.e. not pointers), they are released from memory
when you exit the pro or function... so setting "a=0" should change the
memory used IN the function, but should have no effect when the program
returns to a lower / main level. Indeed, this is correct provided that
a) the variable is not part of the argument of the function, or b)the
variable is not part of a common block.

To avoid memory leak... well... pointers need to be well defined and
cleaned up!

a = ptr_new(indgen(100000000000))
a = 0 ==> you just lost track of the indgen(100000000000) array!!! ...
but it is still in memory!

Jean
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: multiple plots and pages to ps file
Next Topic: Re: envi_get_data

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

Current Time: Sun Oct 12 04:42:00 PDT 2025

Total time taken to generate the page: 1.60597 seconds