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
Memory use increase in function _tkinter._flatten #88774
Comments
In the following code, the memory use of function _tkinter._flatten is increase as the number of calls when I input an illegal value. import sys
import tracemalloc
import _tkinter
arg_list = []
arg_list.append('ptqiioaaejhdoat')
# check for memory usage
memory_recorder = []
tracemalloc.start()
start_snapshot = tracemalloc.take_snapshot()
for i in range(0, 100):
try:
_tkinter._flatten(arg_list[0])
except:
pass
if i % 10 == 0:
one_snapshot = tracemalloc.take_snapshot()
memory_recorder.append(one_snapshot.compare_to(start_snapshot, 'lineno')[0])
for i in range(2, len(memory_recorder)):
if str(memory_recorder[i].traceback) == str(memory_recorder[1].traceback):
print(memory_recorder[i].traceback)
print(memory_recorder[i].size)
tracemalloc.stop() And the output on my machine is |
Thank you for your report stardust222. Indeed, there is a leak if an argument is a sequence or set, but not list or tuple. PR 27107 fixes it. |
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: