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

Home » Public Forums » archive » IDL Memory Leaks
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
IDL Memory Leaks [message #27679] Mon, 05 November 2001 09:53 Go to next message
Myron Brown is currently offline  Myron Brown
Messages: 10
Registered: December 1999
Junior Member
Recently, I have noticed that my IDL programs leak memory, but I never
use pointers directly. This is true when running with IDL on a Windows
PC or on an SGI workstation. Widgets seem to be one source of
problems. File I/O seems to be another, but I'm not yet sure. Due to
the problems I'm having with memory leaks, my long runs eventually die
when memory is exhausted.

Does anyone have any hints on ways to avoid memory leaks in IDL?

Please reply to my e-mail address, since I don't often use newsgroups.

Thanks.

Myron Brown
Myron.Brown@jhuapl.edu
JHU Applied Physics Lab
Re: IDL Memory Leaks [message #27830 is a reply to message #27679] Tue, 06 November 2001 13:21 Go to previous message
Stein Vidar Hagfors H[1] is currently offline  Stein Vidar Hagfors H[1]
Messages: 56
Registered: February 2000
Member
David Fanning <david@dfanning.com> writes:

> JD Smith (jdsmith@astro.cornell.edu) writes:
>
>> Correction, kindly pointed out by an RSI developer... the feature
>> introduced to put a halt to David's perverse misuse of base widgets was
>> *handles*, not pointers. Interestingly, he also filled me in that
>> handles in fact *were* base widgets internally, stripped of everything
>> by the uvalue. I had obviously attempted to elide those from my memory,
>> and not without due cause. Let's hope we remember handles only as a
>> curious side-excursion in IDL history, and insist on pointers in all our
>> code.
>
> While we are getting a history lesson, I'll just
> point out that using unrealized base widgets as pointers,
> handles, or whatever, was not my idea. Like most of my
> really good ideas, I stole this one from someone smarter
> than me, Josh Goldstein, who was one of the best IDL programmers
> I ever saw. He could write IDL code faster than I could think!
>
> I admit that I publicized this perverse idea,
> but only because I found it useful for building
> weird data sets and I found the notion of "pointers"
> helpful in flogging IDL programming courses.
>
> I still run into an occasional program that uses
> unrealized base widgets in this way. And I'm
> happy to say those programs still run. :-)

Hey! I don't know where *you* got this idea from, but *I* have
programs (still in use) from 1994 (the documentation headers were
added 11 June that year..). In one of them, I even mention that "in
IDL versions 3.1 or later," this or that may appear to disappear, but
can always be recovered through a different routine (since the
introduction of the NO_COPY keyword...).

But alas, I think I converted to handles somewhere along the line..

--
------------------------------------------------------------ --------------
Stein Vidar Hagfors Haugan
ESA SOHO SOC/European Space Agency Science Operations Coordinator for SOHO

NASA Goddard Space Flight Center, Email: shaugan@esa.nascom.nasa.gov
Mail Code 682.3, Bld. 26, Room G-1, Tel.: 1-301-286-9028/240-354-6066
Greenbelt, Maryland 20771, USA. Fax: 1-301-286-0264
------------------------------------------------------------ --------------
Re: IDL Memory Leaks [message #27836 is a reply to message #27679] Tue, 06 November 2001 10:16 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
JD Smith (jdsmith@astro.cornell.edu) writes:

> Correction, kindly pointed out by an RSI developer... the feature
> introduced to put a halt to David's perverse misuse of base widgets was
> *handles*, not pointers. Interestingly, he also filled me in that
> handles in fact *were* base widgets internally, stripped of everything
> by the uvalue. I had obviously attempted to elide those from my memory,
> and not without due cause. Let's hope we remember handles only as a
> curious side-excursion in IDL history, and insist on pointers in all our
> code.

While we are getting a history lesson, I'll just
point out that using unrealized base widgets as pointers,
handles, or whatever, was not my idea. Like most of my
really good ideas, I stole this one from someone smarter
than me, Josh Goldstein, who was one of the best IDL programmers
I ever saw. He could write IDL code faster than I could think!

I admit that I publicized this perverse idea,
but only because I found it useful for building
weird data sets and I found the notion of "pointers"
helpful in flogging IDL programming courses.

I still run into an occasional program that uses
unrealized base widgets in this way. And I'm
happy to say those programs still run. :-)

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
Re: IDL Memory Leaks [message #27843 is a reply to message #27679] Tue, 06 November 2001 06:57 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Stein Vidar Hagfors Haugan (shaugan@esa.nascom.nasa.gov) writes:
>
> In fact, you're quite correct. The amount of space used to store an
> undefined variable is exacly the same as that used to store a scalar
> zero..

No doubt. But at least UNDEFINE conveys some information. :-)

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
Re: IDL Memory Leaks [message #27850 is a reply to message #27679] Tue, 06 November 2001 02:33 Go to previous message
R.Bauer is currently offline  R.Bauer
Messages: 1424
Registered: November 1998
Senior Member
Altyntsev Dmitriy wrote:
>
> Myron Brown <brownmz1@jhuapl.edu> wrote in message news:<3BE6D215.ADD7D9DC@jhuapl.edu>...
>> Recently, I have noticed that my IDL programs leak memory, but I never
>> use pointers directly. This is true when running with IDL on a Windows
>> PC or on an SGI workstation. Widgets seem to be one source of
>> problems. File I/O seems to be another, but I'm not yet sure. Due to
>> the problems I'm having with memory leaks, my long runs eventually die
>> when memory is exhausted.
>>
>> Does anyone have any hints on ways to avoid memory leaks in IDL?
>>
>> Please reply to my e-mail address, since I don't often use newsgroups.
>>
>> Thanks.
>>
>> Myron Brown
>> Myron.Brown@jhuapl.edu
>> JHU Applied Physics Lab
>
> About a year ago I ran into memory leakage on Windows NT with IDL 5.2.
> It was very simple program using just I/0. The problem was solved by
> changing some Windows NT option. I can't remember now its exact name
> (and I don't have NT nearby) but it was concerned application memory
> allocation priority. If it is your case and you can't find this option
> yourself e-mail me without hesitation.
>
> Altyntsev Dmitriy

Someone else told me the same about memory problems with idl5 and
windows 2000
But I have never seen it myself.

Are you able to test your program on a different platform e.g. linux or
unix or win98?

If not please share a small examle of your code as Mark mentioned.

Reimar


--
Reimar Bauer

Institut fuer Stratosphaerische Chemie (ICG-1)
Forschungszentrum Juelich
email: R.Bauer@fz-juelich.de
http://www.fz-juelich.de/icg/icg1/
============================================================ ======
a IDL library at ForschungsZentrum Juelich
http://www.fz-juelich.de/icg/icg1/idl_icglib/idl_lib_intro.h tml

http://www.fz-juelich.de/zb/text/publikation/juel3786.html
============================================================ ======

read something about linux / windows
http://www.suse.de/de/news/hotnews/MS.html
Re: IDL Memory Leaks [message #27851 is a reply to message #27679] Mon, 05 November 2001 22:15 Go to previous message
alt is currently offline  alt
Messages: 28
Registered: August 2001
Junior Member
Myron Brown <brownmz1@jhuapl.edu> wrote in message news:<3BE6D215.ADD7D9DC@jhuapl.edu>...
> Recently, I have noticed that my IDL programs leak memory, but I never
> use pointers directly. This is true when running with IDL on a Windows
> PC or on an SGI workstation. Widgets seem to be one source of
> problems. File I/O seems to be another, but I'm not yet sure. Due to
> the problems I'm having with memory leaks, my long runs eventually die
> when memory is exhausted.
>
> Does anyone have any hints on ways to avoid memory leaks in IDL?
>
> Please reply to my e-mail address, since I don't often use newsgroups.
>
> Thanks.
>
> Myron Brown
> Myron.Brown@jhuapl.edu
> JHU Applied Physics Lab

About a year ago I ran into memory leakage on Windows NT with IDL 5.2.
It was very simple program using just I/0. The problem was solved by
changing some Windows NT option. I can't remember now its exact name
(and I don't have NT nearby) but it was concerned application memory
allocation priority. If it is your case and you can't find this option
yourself e-mail me without hesitation.

Altyntsev Dmitriy
Re: IDL Memory Leaks [message #27857 is a reply to message #27679] Mon, 05 November 2001 17:14 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Mark Hadfield (m.hadfield@niwa.cri.nz) writes:

> I guess the only way to pin this down is to keep on stripping stuff out of
> your code until the memory leak stops (or doesn't). Can you get it into a
> form where you could post it on the group for others to play with? I know
> David & JD would love to have a go.

Uh, right. But I draw the line at more than five
lines of unsolicited code. It's a quagmire and
usually too demoralizing otherwise. :-(

Cheers,

David

P.S. And by the way, I am *still* waiting for that
update on reversing axes, Mark. :-)

--
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
Re: IDL Memory Leaks [message #27867 is a reply to message #27679] Mon, 05 November 2001 14:53 Go to previous message
John-David T. Smith is currently offline  John-David T. Smith
Messages: 384
Registered: January 2000
Senior Member
David Fanning wrote:
>
> JD Smith (jdsmith@astro.cornell.edu) writes:
>
>> While I agree that managing memory leaks can be challenging, I'm not
>> sure these Draconian measures are indicated.
>
> JD, while you are waiting for those thesis ideas
> to germinate, why don't you write up a Memory Management
> Tutorial to go with your Dimensional Juggling and
> Array Concatenation Tutorials:

I'll think about it, but you forget: I was liberated from the bonds of
thesisdom last May! ...which of course means I have a real job now
(well, as real as an Astronomy job gets), and deadlines to meet.
Besides, I promised histogram() was next ;)

JD
Re: IDL Memory Leaks [message #27869 is a reply to message #27679] Mon, 05 November 2001 14:35 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
JD Smith (jdsmith@astro.cornell.edu) writes:

> While I agree that managing memory leaks can be challenging, I'm not
> sure these Draconian measures are indicated.

JD, while you are waiting for those thesis ideas
to germinate, why don't you write up a Memory Management
Tutorial to go with your Dimensional Juggling and
Array Concatenation Tutorials:

http://www.dfanning.com/documents/tips.html#Tutorials

I've see there are all kinds of primary sources from
old newsgroup articles, but we need something in one
place. I'd do it, but if I don't start doing a little
work around here my kids are going to end up busing
dishes down at the Golden Corral instead of going to
college. :-(

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
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: IDL 5.5 call_external passing strings
Next Topic: how to save the xobjview image into a file IN COLOR ?

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

Current Time: Wed Oct 08 19:44:02 PDT 2025

Total time taken to generate the page: 0.00763 seconds