New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Tkinter Tcl-commands memory-leaks #43687
Comments
Fix 8 memory-leaks by cleaning up created Tcl commands I attach a patch against Tkinter 47021. === Long explanation === I was bitten by a memory leak in Tkinter - 25MB per day I searched for more similar leaks, and fixed them too. The reasoning for patch bpo-1121234 gives the reason for See http://www.uk.debian.org/~graham/python/tkleak.py |
Logged In: YES The python version I am using in production is 2.1 (for I can generate a patch against any of the older versions |
Logged In: YES I fixed a bug in the original patch: when destroying a Also fixed 4 more leaks occurring when TclError is raised I have added 6 tests to tkleak.py to test the additional 4 The patch is against 50704, hope it helps. Thanks for your hard work, and for accepting my other |
Logged In: YES The patch looks wrong. Why are you deleting the _tkcommands What is the purpose of the changes to trace_variable? You Why are you catching TclError in so many cases? Under what I think I would prefer if this patch was split into many |
Logged In: YES
AIUI, Tkinter callbacks (Button and Scrollbar commands, Text
Is it the aim for Tkinter to work in a similar way to
The following all raise TclError: When the exception is raised, the 'eggs' Tcl command for the
Sorry for the rushed patch, I noticed the release schedule Many thanks, Graham Horler |
Something like the proposed patch is still needed. But allow me to point
cbs = self._bind_names(self._bind(('bind', self._w), sequence,
func=None, add=None)) could be only: cbs = self._bind_names(self.bind(sequence)) and the comment in the end should go.
Hopefully you are still around. |
The changes in Misc.destroy do not look right, why are you deleting It would make more sense to not apply these changes in Misc.destroy, |
A little remark : please replace "if not |
Fix: My previous comment was about changes in Misc.deletecommand not To Quentin: I wouldn't bother mentioning it since this new TkinterError |
Rethinking about the changes done in Misc._configure I found out that I've applied these changes and others commented before in a thing I'm I didn't fix the ones related to Variable yet, but if any of these |
I've fixed the leaks in Variable doing this: I don't use an extra _tclCommands for Variable, instead in __del__ I use |
On Wed, Dec 17, 2008 at 3:51 PM, Guilherme Polo <report@bugs.python.org> wrote:
Uhm, this will fail in other places in Tkinter that are using _options |
I hope you are not too bored for me commenting on this again. So, I have re-though about this issue today and decided to solve it The other problems reported in this issue are also solved by it, and Another advantage of this solution is that extensions benefit from it, |
Given the current debate on python-dev regarding IDLE and its dependancy on tkinter, surely something as serious as a memory leak should be looked into. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: