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

Home » Public Forums » archive » Re: about memory
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: about memory [message #25145 is a reply to message #25143] Tue, 22 May 2001 07:30 Go to previous messageGo to previous message
Med Bennett is currently offline  Med Bennett
Messages: 109
Registered: April 1997
Senior Member
Craig Markwardt wrote:

> Amar Nayegandhi <anayegan@csee.usf.edu> writes:
>
>> This is a general question about memory management.
>> can i free memory allocated to an array if I have finished using it in
>> the program? suppose
>> arr_a = fltarr(10000,10000)
>> if i don't need array arr_a anymore, would
>> arr_a = 0
>> free the memory used by arr_a? I would expect it to now utilize only
>> 2(or 4) bytes of memory.
>
> The answer to the question is "yes," but also "it depends." The
> answer is "yes" because the memory is indeed made available again to
> the same IDL process. I use
>
> A = 0
>
> every day when I am done with a variable. It's totally legit. Hong
> may need go no further than this, although I agree that he's dealing
> with extremely large arrays which might be better suited with a tiled
> or chunked approach.
>
> The answer is also "it depends," because it depends on which platform
> you are using. I believe that under Windows the memory is actually
> returned to the OS. Thus, other programs are able to use the memory
> again. Under Unix this is much less likely, so once the memory is
> allocated to one session of IDL, it stays there until the session ends
> (and is not available to another process). [ I think this is not
> *always* true, but mostly true. ]
>
> Every so often somebody asks, "why is IDL eating all my memory?" It's
> basically unavoidable. Sorry for this diversion.
>
> Craig
>
> --
> ------------------------------------------------------------ --------------
> Craig B. Markwardt, Ph.D. EMAIL: craigmnet@cow.physics.wisc.edu
> Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
> ------------------------------------------------------------ --------------

Just curious - why not 'delvar,a'? Is this not as effective (or more so) than
'a=0'?
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: [Newbie]writing JPEG or GIF file with plot?
Next Topic: Checkbox Starting Checked

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

Current Time: Wed Oct 08 15:12:35 PDT 2025

Total time taken to generate the page: 0.00354 seconds