ChatCrawlersearch across public Telegram Open the app
Q

Qt for Python (PySide/Shiboken)

17 June 2023
2023-06-17×
17 June 2023
Hi, I found that version after pysde6.4.0 has very serious memory leaks
The code like this: def func(): button = QPushButton() def _f(s): print("=========s:", s) button.clicked.connect(partial(_f, "222")) # # for i in range(100): # func() def _run(): import gc gc.collect() import objgraph objgraph.show_growth() ins = objgraph.by_type("QPushButton") func() print("======len:", len(ins)) QTimer.singleShot(1000, _run) _run()
I
Show_growth print which type is "function" always increase. And when i use PyQt6.5 or PySide6.3.2, it's not appear memory leak.
A
Looks like a recursion with lots of QTimers. And buttons, probably. I haven't worked with objgraph.
I
I used the top-level widget in the signal in the actual project, so even if the window is closed, it will not be destroyed. This has a huge impact
A
As a side note, please post the code elsewhere, for in the IRC chat, they see a message for every line you send here.
Calendar: June 2023
Archive by month
Open in Telegram Каталог площадок Искать в ChatCrawler

A snapshot of an open public feed from the search index ChatCrawler — “Google for public Telegram”; refreshed as the venue is crawled. Times are UTC.

Public content only, official Telegram API. About · FAQ · What we do not do · Remove a page · Catalog