help tcl problem

F

francesco.grillo

Hi to all ,
i have a blocking pb .
I use python 2.3 with tk/tcl 8.4.7 under windows2000;i wrote an application
that in the begining
under window systems was very instable , frequently crashed now and then
without a reason .
I found out that recompiling the tcl / tk libraries with "TCL_THREADS=1"
flag
these instability went away . Unfortunatelly there is a side effect that
is :
Memory allocation grow each time a call to tk is done .
Since my application heavly use tk and is supposed to stay on days and days
without shuting down , what it happens is that, after a while the memory
used by
applications is increased by Megas .
Below i wrote a very simple .py that demostrates how is easy to grab memory
from the system just calling the bell method in an infinite loop .

Thank for the help , Francesco Grillo




from Tkinter import *
import threading
import time
import gc
import os

class Ticker:
def __init__(self):
self.l = Label(text="W")

print 'init '
def start(self):
self.thread = threading.Thread(target=self.tickerThread)
self.thread.start()

def tickerThread(self):
while(1):
self.l.bell()

root = Tk()
root.geometry("200x150+0+0")
ticker1 = Ticker()
ticker1.start()
root.mainloop()
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,074
Latest member
StanleyFra

Latest Threads

Top