Movatterモバイル変換


[0]ホーム

URL:


homepage

Issue34794

This issue trackerhas been migrated toGitHub, and is currentlyread-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title:Memory leak in Tkinter
Type:resource usageStage:resolved
Components:TkinterVersions:Python 3.8, Python 3.7, Python 3.6, Python 2.7
process
Status:closedResolution:fixed
Dependencies:Superseder:
Assigned To:Nosy List: dtalkin, miss-islington, serhiy.storchaka, vstinner, xtreak
Priority:normalKeywords:patch

Created on2018-09-24 21:30 bydtalkin, last changed2022-04-11 14:59 byadmin. This issue is nowclosed.

Files
File nameUploadedDescriptionEdit
leak_demo.pydtalkin,2018-09-25 14:24
leak_demo2.pyserhiy.storchaka,2018-10-21 11:56
Pull Requests
URLStatusLinkedEdit
PR 9559closedserhiy.storchaka,2018-09-25 08:07
PR 10025mergedserhiy.storchaka,2018-10-21 11:57
PR 10069mergedmiss-islington,2018-10-23 19:41
PR 10070mergedmiss-islington,2018-10-23 19:41
PR 10181mergedserhiy.storchaka,2018-10-28 16:50
Messages (8)
msg326289 -(view)Author: David Talkin (dtalkin)Date: 2018-09-24 21:30
The Tkinter.PhotoImage class leaks memory with each change of the 'data' Attribute due to Image calling tk._createbytearray, which allocates memory, but never frees it.The offending method is in the TkApp class, _createbytearray().
msg326327 -(view)Author: Karthikeyan Singaravelan (xtreak)*(Python committer)Date: 2018-09-25 06:55
Thanks for the report David. Feel free to attach reproducible script if any that might trigger this. I am adding Serhiy who might have a better understanding of this. Relevant issue where _createbytearray was added :issue21580 .
msg326355 -(view)Author: David Talkin (dtalkin)Date: 2018-09-25 14:24
Attached please find a Python script that demonstrates the bug.DavidOn Tue, Sep 25, 2018 at 2:55 AM Karthikeyan Singaravelan <report@bugs.python.org> wrote:>> Karthikeyan Singaravelan <tir.karthi@gmail.com> added the comment:>> Thanks for the report David. Feel free to attach reproducible script if> any that might trigger this. I am adding Serhiy who might have a better> understanding of this. Relevant issue where _createbytearray was added :>issue21580 .>> ----------> nosy: +serhiy.storchaka, xtreak>> _______________________________________> Python tracker <report@bugs.python.org>> <https://bugs.python.org/issue34794>> _______________________________________>
msg328205 -(view)Author: Serhiy Storchaka (serhiy.storchaka)*(Python committer)Date: 2018-10-21 11:56
Here is a simpler reproducer.Actually the problem was not in _createbytearray(), but in converting the Python wrapper around Tcl_Obj into Tcl_Obj. _createbytearray() just exposed it. The leak exists in Python 3 too, but it is hard to reproduce it.
msg328338 -(view)Author: Serhiy Storchaka (serhiy.storchaka)*(Python committer)Date: 2018-10-23 19:40
New changesetdf13df41a25765d8a39a77220691698498e758d4 by Serhiy Storchaka in branch 'master':bpo-34794: Fix a leak in Tkinter. (GH-10025)https://github.com/python/cpython/commit/df13df41a25765d8a39a77220691698498e758d4
msg328342 -(view)Author: miss-islington (miss-islington)Date: 2018-10-23 20:25
New changeset2c549250d8fd6755e3338a771d250e34c78bdb50 by Miss Islington (bot) in branch '3.6':bpo-34794: Fix a leak in Tkinter. (GH-10025)https://github.com/python/cpython/commit/2c549250d8fd6755e3338a771d250e34c78bdb50
msg328347 -(view)Author: STINNER Victor (vstinner)*(Python committer)Date: 2018-10-23 21:46
New changesetf7cefb427cbc50d89a4f19f7f334a4f5421cefd3 by Victor Stinner (Miss Islington (bot)) in branch '3.7':bpo-34794: Fix a leak in Tkinter. (GH-10025) (GH-10069)https://github.com/python/cpython/commit/f7cefb427cbc50d89a4f19f7f334a4f5421cefd3
msg328715 -(view)Author: Serhiy Storchaka (serhiy.storchaka)*(Python committer)Date: 2018-10-28 17:36
New changesetaaea2802da0a074c695ab86911d8bcc0b2dd5ec5 by Serhiy Storchaka in branch '2.7':[2.7]bpo-34794: Fix a leak in Tkinter. (GH-10025) (GH-10181)https://github.com/python/cpython/commit/aaea2802da0a074c695ab86911d8bcc0b2dd5ec5
History
DateUserActionArgs
2022-04-11 14:59:06adminsetgithub: 78975
2018-10-28 19:14:46serhiy.storchakasetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2018-10-28 17:36:06serhiy.storchakasetmessages: +msg328715
2018-10-28 16:50:30serhiy.storchakasetpull_requests: +pull_request9504
2018-10-23 21:46:43vstinnersetnosy: +vstinner
messages: +msg328347
2018-10-23 20:25:57miss-islingtonsetnosy: +miss-islington
messages: +msg328342
2018-10-23 19:41:18miss-islingtonsetpull_requests: +pull_request9403
2018-10-23 19:41:10miss-islingtonsetpull_requests: +pull_request9402
2018-10-23 19:40:58serhiy.storchakasetmessages: +msg328338
2018-10-21 12:05:09serhiy.storchakasettitle: memory leak in TkApp:_createbytearray -> Memory leak in Tkinter
2018-10-21 11:57:08serhiy.storchakasetpull_requests: +pull_request9364
2018-10-21 11:56:54serhiy.storchakasetfiles: +leak_demo2.py

messages: +msg328205
versions: + Python 3.6, Python 3.7, Python 3.8
2018-09-25 14:24:46dtalkinsetfiles: +leak_demo.py

messages: +msg326355
2018-09-25 08:07:04serhiy.storchakasetkeywords: +patch
stage: patch review
pull_requests: +pull_request8961
2018-09-25 06:55:24xtreaksetnosy: +serhiy.storchaka,xtreak
messages: +msg326327
2018-09-24 21:30:12dtalkincreate
Supported byThe Python Software Foundation,
Powered byRoundup
Copyright © 1990-2022,Python Software Foundation
Legal Statements

[8]ページ先頭

©2009-2026 Movatter.jp