Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^3: marbles

by zentara (Archbishop)
on Sep 09, 2005 at 12:37 UTC ( [id://490546]=note: print w/replies, xml ) Need Help??


in reply to Re^2: marbles
in thread marbles

Hi, after writing many Tk programs that run for any period of time, and have alot of "screen action", one of the main problems is Tk's ( and Perl in general) lack of automatic garbage collection. This is not a true memory leak, in the c sense, but just problems with the ref counts of Tk objects not going to zero(for various reasons) and stray objects get left laying around. This can cause the memory usage to climb at a perceptible rate.

The first thing I do, with any Tk program is monitor it's memory usage as it runs, to see if it stays stable after a few minutes. See linux memory leak monitor for the handy little monitoring tool I use.

These memory gains, usually come when writers undef objects and recreate them, or when objects have photos associated with them. In liverpole's cool program, he just used a single canvas object, so there was no gain, even though it "appeared" he was creating and destroying screen objects.

By the way, this memory gain problem in GUI programs is not limited to Tk.....it affects all GUIs.


I'm not really a human, but I play one on earth. flash japh

Replies are listed 'Best First'.
Re^4: marbles
by liverpole (Monsignor) on Sep 09, 2005 at 13:13 UTC
    Thanks for the explanation of your memory leak monitor, zentara.   I will definitely investigate it more.

    I did get such a kick out of the "beautiful program and no memory leaks either".  Though I know you probably didn't mean it humorously, it brought images to my mind of spectators in the Louvre admiring a painting, and saying "such masterful artwork, and he didn't color outside of any of the lines!"  :)

    Seriously, though, thanks for all of your generous comments and suggestions.  As Limbic~Region aptly notes, they mean a lot coming from an esteemed monk such as yourself.

      Esteemed monk?

      :-) I actually put myself fairly low on the list, compared to the other monks here. Sainthood comes far too easily here. :-)


      I'm not really a human, but I play one on earth. flash japh

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://490546]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (4)
As of 2024-04-19 16:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found