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 #58321 is a reply to message #58225] Wed, 23 January 2008 13:28 Go to previous message
Jaime is currently offline  Jaime
Messages: 6
Registered: January 2008
Junior Member
I dug into the code and found that these variables are defined in a
COMMON block. Why are they still using memory after the program
finished? can they be destroyed altogether (e.g. common_block=0)?

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 12:17:40 PDT 2025

Total time taken to generate the page: 1.60226 seconds