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

Home » Public Forums » archive » Re: IDL Memory Leaks
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: IDL Memory Leaks [message #27672 is a reply to message #27671] Mon, 05 November 2001 13:21 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Myron Brown (brownmz1@jhuapl.edu) writes:

> 4. The code includes repetitive reassignments of variables to large arrays,
> even within a routine (still in scope). I tried to assign variables to zero
> each time, but it doesn't seem to make a difference. Should this really be
> necessary?

I'd like to see how you are doing this (I hope you
are using the TEMPORARY function!), as this is more
than likely the source of your problem. You don't say
how you know you are "leaking memory", but this is the
kind of thing that will eat up process memory if you
are not careful.

If you have the same variable on both sides of an equal
sign, you really need something like this:

image = Temporary(image) * 5

And when you are done with it:

Undefine, image

(The UNDEFINE program can be found on my web page.)

Otherwise, you continually get more and more process
memory (with malloc), and there is no way to give it
back.

"Is it necessary?". Yes, it is very, very necessary. :-)

Cheers,

David
--
David W. Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: NETSCAPE BOMB - dont open/preview "Re: my pretty floor won't pour before I expect it"
Next Topic: FFT issues

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

Current Time: Sat Oct 11 03:14:29 PDT 2025

Total time taken to generate the page: 1.19862 seconds