E
Elbert Lev
#When I'm running this script on my windows NT4.0 box,
#every time dialog box is reopened there is memory growth 384K.
#Bellow is the text I sent to Stephen Ferg (author of easygui)
# I have tested the pure Tkinter,
# by modifiing on of the examples in the distribution.
# This little guy also exibits the same behaviour.
# Namely: every time the window is closed and reoppend,
# there is memory leak of several hundreds 384K
# (good number??? 256 + 128??? or it's windows?)
# del root does not help at all.
# Anyway, I don't think that this leak is in easygui.
# The leak (if any is in TKinter (or it's windows implementation).
# I'm not runnin linux in my shop, so I will ask my friends to tes it on linux,
# will keep you posted.
from Tkinter import *
import string
# This program shows how to use a simple type-in box
class App(Frame):
def __init__(self, master=None):
Frame.__init__(self, master)
self.pack()
self.entrythingy = Entry()
self.entrythingy.pack()
# and here we get a callback when the user hits return. we could
# make the key that triggers the callback anything we wanted to.
# other typical options might be <Key-Tab> or <Key> (for anything)
self.entrythingy.bind('<Key-Return>', self.print_contents)
def print_contents(self, event):
print "hi. contents of entry is now ---->", self.entrythingy.get()
while 1:
root = App()
root.master.title("Foo")
root.mainloop()
del root
#I found this memory leak while working with easygui.
#Initially I thought, that the leak is caused by the way easygui opens
#and closes the window/application.
#But plain Tkinter also has leaks. What is wrong?
#A friend of mine ran this script on his MAC and here is his reply:
##Yep, I'm seeing a .32 MB leak whenever I close the window and it
##reopens. Also seeing a high number of page faults for that process
##that increase when it is closed, so I think the memory for the window
##is not being deallocated, then Python hits an exception after it page
##faults trying to access it, and it then spawns a new one.
#every time dialog box is reopened there is memory growth 384K.
#Bellow is the text I sent to Stephen Ferg (author of easygui)
# I have tested the pure Tkinter,
# by modifiing on of the examples in the distribution.
# This little guy also exibits the same behaviour.
# Namely: every time the window is closed and reoppend,
# there is memory leak of several hundreds 384K
# (good number??? 256 + 128??? or it's windows?)
# del root does not help at all.
# Anyway, I don't think that this leak is in easygui.
# The leak (if any is in TKinter (or it's windows implementation).
# I'm not runnin linux in my shop, so I will ask my friends to tes it on linux,
# will keep you posted.
from Tkinter import *
import string
# This program shows how to use a simple type-in box
class App(Frame):
def __init__(self, master=None):
Frame.__init__(self, master)
self.pack()
self.entrythingy = Entry()
self.entrythingy.pack()
# and here we get a callback when the user hits return. we could
# make the key that triggers the callback anything we wanted to.
# other typical options might be <Key-Tab> or <Key> (for anything)
self.entrythingy.bind('<Key-Return>', self.print_contents)
def print_contents(self, event):
print "hi. contents of entry is now ---->", self.entrythingy.get()
while 1:
root = App()
root.master.title("Foo")
root.mainloop()
del root
#I found this memory leak while working with easygui.
#Initially I thought, that the leak is caused by the way easygui opens
#and closes the window/application.
#But plain Tkinter also has leaks. What is wrong?
#A friend of mine ran this script on his MAC and here is his reply:
##Yep, I'm seeing a .32 MB leak whenever I close the window and it
##reopens. Also seeing a high number of page faults for that process
##that increase when it is closed, so I think the memory for the window
##is not being deallocated, then Python hits an exception after it page
##faults trying to access it, and it then spawns a new one.