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

Home » Public Forums » archive » Just for fun
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
Just for fun [message #77461] Wed, 07 September 2011 12:54 Go to next message
Bob[4] is currently offline  Bob[4]
Messages: 24
Registered: April 2009
Junior Member
Try this:

p=plot(findgen(10))

help, /Heap

obj_destroy, p

help, /Heap

Yikes! This makes me fear New Graphics.
Re: Just for fun [message #77526 is a reply to message #77461] Fri, 09 September 2011 01:13 Go to previous messageGo to next message
Wout De Nolf is currently offline  Wout De Nolf
Messages: 194
Registered: October 2008
Senior Member
On Wed, 7 Sep 2011 12:54:23 -0700 (PDT), Bob <bobnnamtrop@gmail.com>
wrote:

> Yikes! This makes me fear New Graphics.

Just for fun? Tell that to David, he'll be cracking up ;-)
Re: Just for fun [message #77527 is a reply to message #77461] Fri, 09 September 2011 01:07 Go to previous messageGo to next message
Wout De Nolf is currently offline  Wout De Nolf
Messages: 194
Registered: October 2008
Senior Member
On Wed, 7 Sep 2011 12:54:23 -0700 (PDT), Bob <bobnnamtrop@gmail.com>
wrote:

> Yikes! This makes me fear New Graphics.

Exactly! Even closing the window doesn't clean up everything:

IDL> .RESET_SESSION
IDL> help,/heap
Heap Variables:
# Pointer: 0
# Object : 0
IDL> p=plot(findgen(10))
IDL> help,/heap
Heap Variables:
# Pointer: 5031
# Object : 4425
IDL> obj_destroy,p ; Window is still there
IDL> help,/heap
Heap Variables:
# Pointer: 5031
# Object : 4424
...close window...
IDL> help,/heap
Heap Variables:
# Pointer: 1171
# Object : 1399

This would make sense if the next plot reuses some of these objects:

IDL> p=plot(findgen(10))
IDL> help,/heap
Heap Variables:
# Pointer: 5050
# Object : 4445

It seems to do that, but some objects are not reused/deleted, so
plotting+closing many times increases heap allocation. This serves no
purpose that I can think of.
Re: Just for fun [message #77577 is a reply to message #77527] Mon, 12 September 2011 13:30 Go to previous message
Bob[4] is currently offline  Bob[4]
Messages: 24
Registered: April 2009
Junior Member
Yes, I agree. I should have left out the stuff about obj_destroy, the scary thing is just that 5031 pointer variable and 4425 object variables are made just for a simple plot. (Interestingly I get slightly different numbers for the same command.) At the least idl should hide these heap variables from the user, IMHO.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: More Function Graphics Fun!
Next Topic: resolve_all from inside a procedure?

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

Current Time: Wed Oct 08 17:11:14 PDT 2025

Total time taken to generate the page: 0.00733 seconds