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

Home » Public Forums » archive » 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
Memory Leaks [message #16838] Tue, 24 August 1999 00:00 Go to next message
David is currently offline  David
Messages: 24
Registered: April 1997
Junior Member
Hi All,

I'm new to IDL and have just started going through the IDL Programming
Techniques book (David W. Fanning).

In unix you are able to use bcheck to check for memory leaks. I was
wondering is there a program
that has similar abilities as bcheck but for windows, that can check for
memory leaks in IDL.

I am using Win98 and IDL5.2


Thanks in advance.

David
Re: Memory Leaks [message #16878 is a reply to message #16838] Thu, 26 August 1999 00:00 Go to previous messageGo to next message
steinhh is currently offline  steinhh
Messages: 260
Registered: June 1994
Senior Member
In article <7q35bb$ekf$1@jura.cc.ic.ac.uk> "Justin Ashmall"
<Justin_Ashmall@hotmail.com> writes:

> I should point out that we had some trouble with what appeared
> to be an internal IDL memory leak. We were using IDL 5.1 (under
> NT 4) as control and data aquisition software on processes that
> ran for several days. We were finding that as time progessed the
> memory available to the PC was slowly dropping until the machine
> crashed (taking ~ 18hrs to eat up 100+Mb of memory). Although
> some of this memory leak may have been due to programmatical
> errors, a significant amount of the memory was not released when
> IDL was closed. The only way to recover the memory was to
> reboot. I suppose it is possible that this was due to an error
> in Windows, however NT 4.0 has a fairly good reputation in these
> matters (I'm sure many MS bashers would disagree there though).

Hmmyeah. I cannot see how one could blame a dead program for
hogging memory :-) If the only way to recover was to reboot, I'd
definitely blame it on the operating system.

Of course, the problem may be exacerbated by some internal bad
practice of IDL, but an operating system that doesn't reclaim
all the memory from a dying process is.. well, not a good
operating system.

Another matter is that IDL may be causing other processes to hog
memory - I think this sometimes occurred with the X servers on
Unix systems. A reboot wasn't necessary, though, only a restart
of the X server, which can be done e.g. on console logout.

Regards,

Stein Vidar
Re: Memory Leaks [message #16880 is a reply to message #16838] Thu, 26 August 1999 00:00 Go to previous messageGo to next message
Justin Ashmall is currently offline  Justin Ashmall
Messages: 15
Registered: May 1999
Junior Member
> Its important to realize that the type of memory leaks that can happen
> in IDL (barring internal IDL bugs) ...

I should point out that we had some trouble with what appeared to be an
internal IDL memory leak. We were using IDL 5.1 (under NT 4) as control and
data aquisition software on processes that ran for several days. We were
finding that as time progessed the memory available to the PC was slowly
dropping until the machine crashed (taking ~ 18hrs to eat up 100+Mb of
memory). Although some of this memory leak may have been due to
programmatical errors, a significant amount of the memory was not released
when IDL was closed. The only way to recover the memory was to reboot. I
suppose it is possible that this was due to an error in Windows, however NT
4.0 has a fairly good reputation in these matters (I'm sure many MS bashers
would disagree there though).

Justin
Re: Memory Leaks [message #16909 is a reply to message #16838] Tue, 24 August 1999 00:00 Go to previous messageGo to next message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Tom Kluegel (kluegel@lanl.gov) writes:

> The closest thing I know is:
> IDL> HEAP_GC, /VERBOSE
>
> It might be good enough for your purposes, but it insists on actually
> deallocating the leaked heap memory, not just telling you about them.

Well, HELP, /HEAP will tell you about what you have
on the heap (but not which heap variables have
no current reference). This is often enough to figure
out where you are leaking.

HEAP_GC, of course, should only be used when your
office door is closed and no one is looking over
your shoulder. Real programmers don't need it
or use it. :-)

Cheers,

David

P.S. In practice, leakage tests work like this:

1. Type Heap_GC to clean all leaking heap variables.
2. Type Help, /Heap to see if anything is left (usually not).
3. Run your program and exit.
4. Type Help, /Heap to see if there is anything left now.

If there is, you are leaking. Usually it is just a matter of
adding the appropriate Ptr_Free or Obj_Destroy command to
the Cleanup routine.

--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
Re: Memory Leaks [message #16912 is a reply to message #16838] Tue, 24 August 1999 00:00 Go to previous messageGo to next message
kluegel is currently offline  kluegel
Messages: 11
Registered: February 1999
Junior Member
In article <37C22D54.12C9EDC1@ihug.com.au>,
David <pharoh@ihug.com.au> wrote:
> In unix you are able to use bcheck to check for memory leaks. I was
> wondering is there a program that has similar abilities as bcheck but
> for windows, that can check for memory leaks in IDL.

Its important to realize that the type of memory leaks that can happen
in IDL (barring internal IDL bugs), are chunks of IDL heap memory that
are lost to an IDL program, but they are not actually lost to the IDL
interpreter. Its the IDL interpreter that manages the IDL heap, and
gives pieces or takes back pieces upon request by the IDL program. The
pointer you receive from PTR_NEW, or give via PTR_FREE is really just a
logical reference to a piece of the IDL heap, not a direct pointer into
the computer's memory. Only the IDL interpreter understands it. An MS
Windows-level utility doesn't have any way of knowing about those kind
of memory leaks. Only an IDL-level utility can accomplish the needed
functionality. If there's a utility to help you in this manner, its
either written in IDL or is a provided functionality as a part of IDL.
So it would most likely be available on all IDL platforms.

The closest thing I know is:
IDL> HEAP_GC, /VERBOSE

It might be good enough for your purposes, but it insists on actually
deallocating the leaked heap memory, not just telling you about them.

Hope this helps.
-- Tom


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
Re: Memory Leaks [message #16928 is a reply to message #16838] Mon, 30 August 1999 00:00 Go to previous message
Michael Werger is currently offline  Michael Werger
Messages: 34
Registered: May 1997
Member
David <pharoh@ihug.com.au> wrote:
>
> Hi All,
>
> I'm new to IDL and have just started going through the IDL Programming
> Techniques book (David W. Fanning).
>
> In unix you are able to use bcheck to check for memory leaks. I was
> wondering is there a program
> that has similar abilities as bcheck but for windows, that can check for
> memory leaks in IDL.
>
> I am using Win98 and IDL5.2

Hmm, I think this is a special story with Win98 because of the
different handling of malloc() here compared to other OSs. In principle,
there should not be any mem leak in Win98 version of IDL. Did you
encounter this? And report this to RSI? They purchases some software
for exactly avoiding mem leaks in IDL for Win98(95 too)

--
Michael Werger ------------o
ESA ESTEC & Praesepe B.V. |
Astrophysics Division mwerger@astro.estec.esa.nl|
| Postbus 299 http://astro.estec.esa.nl |
| 2200 AG Noordwijk +31 71 565 3783 (Voice)
o------------------- The Netherlands +31 71 565 4690 (FAX)
Re: Memory Leaks [message #16948 is a reply to message #16838] Fri, 27 August 1999 00:00 Go to previous message
m218003 is currently offline  m218003
Messages: 56
Registered: August 1999
Member
In article <7q35bb$ekf$1@jura.cc.ic.ac.uk>,
"Justin Ashmall" <Justin_Ashmall@hotmail.com> writes:
>
>
> I should point out that we had some trouble with what appeared to be an
> internal IDL memory leak. We were using IDL 5.1 (under NT 4) as control and
> data aquisition software on processes that ran for several days. We were
> finding that as time progessed the memory available to the PC was slowly
> dropping until the machine crashed (taking ~ 18hrs to eat up 100+Mb of
> memory).

how do you get your data into IDL? If you are using CALL_EXTERNAL or the
likes: are you 100% sure, the leak is not stemming from your linked program
rather than IDL itself? One way to test would be to replace the external
program with some dummy IDL routine to provide you with dummy data. If
the leak still occurs, well, then it's probably IDL (if not Windows).

Martin


--
[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[ [[[[[[[
[[ Martin Schultz Max-Planck-Institut fuer Meteorologie [[
[[ Bundesstr. 55, 20146 Hamburg [[
[[ phone: +49 40 41173-308 [[
[[ fax: +49 40 441787 [[
[[ martin.schultz@dkrz.de [[
[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[ [[[[[[[
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: NT IDL Crashes
Next Topic: VIP

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

Current Time: Wed Oct 08 17:36:06 PDT 2025

Total time taken to generate the page: 0.00470 seconds