[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    Memory leaks related to pyqtSignals
From:       kristof.mulier () telenet ! be
Date:       2021-01-29 12:32:56
Message-ID: 888991925.53592755.1611923576644.JavaMail.zimbra () telenet ! be
[Download RAW message or body]

Hi, 

I've been reading the mail thread from September 2019 concerning "Possible memory \
leak with signal connections". The last mail from this thread is this one: 

[ https://www.riverbankcomputing.com/pipermail/pyqt/2019-September/042180.html | \
https://www.riverbankcomputing.com/pipermail/pyqt/2019-September/042180.html ] 

The mail ends like this: 

> [Phil] Are you expecting that the Python interpreter will return unused memory 
to the operating system? 

> [Kevin] My assumption was that the memory usage from the signal connections \
> wouldn't "build up" (i.e. that memory usage would be independent of the number of \
> SignalObjects instantiated), which seems to be what happens with the pyqtSlot \
> decorated version. In create_slot_objects, each SlotObject is instantiated, which \
> connects the signals, and then should be immediately garbage collected, which \
> should disconnect the signals. In the version of the script without the pyqtSlot \
> decorators, the number reported for "Memory after slot objects creation" is \
> proportional to the number of SlotObject instances created, which is why I'd \
> assumed memory had leaked, but I could certainly be thinking through things wrong. 

I would like to know how the story ends. Is this an actual memory leak? Or is it \
*just* the Python interpreter keeping the unused memory to itself? 

I've got some more questions regarding properly "destroying" QtObject()s and their \
signals. If you have time, please have a look here: [ \
https://stackoverflow.com/questions/65953772/will-the-following-code-disconnect-all-incoming-or-outgoing-pyqt-signals \
| https://stackoverflow.com/questions/65953772/will-the-following-code-disconnect-all-incoming-or-outgoing-pyqt-signals \
] 

Thank you very much :-) 

Kind regards, 
Kristof 


[Attachment #3 (text/html)]

<html><body><div style="font-family: Verdana, Arial, Helvetica, sans-serif; \
font-size: 10pt; color: #000000"><div>Hi,<br><br>I've been reading the mail thread \
from September 2019 concerning "Possible memory leak with signal connections". The \
last mail from this thread is this one:<br data-mce-bogus="1"></div><div><br \
data-mce-bogus="1"></div><div><a \
href="https://www.riverbankcomputing.com/pipermail/pyqt/2019-September/042180.html">ht \
tps://www.riverbankcomputing.com/pipermail/pyqt/2019-September/042180.html</a><br \
data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div>The mail ends like \
this:<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div><em><span \
style="color: rgb(128, 128, 128);" data-mce-style="color: #808080;">&gt; [Phil] Are \
you expecting that the Python interpreter will return unused \
memory</span></em><br><em><span style="color: rgb(128, 128, 128);" \
data-mce-style="color: #808080;">to the operating \
system?</span></em><br><br><em><span style="color: rgb(128, 128, 128);" \
data-mce-style="color: #808080;">&gt; [Kevin] My assumption was that the memory usage \
from the signal connections wouldn't "build up" (i.e. that memory usage would be \
independent of the number of SignalObjects instantiated), which seems to be what \
happens with the pyqtSlot decorated version.&nbsp; In create_slot_objects, each \
SlotObject is instantiated, which connects the signals, and then should be \
immediately garbage collected, which should disconnect the signals.&nbsp; In the \
version of the script without the pyqtSlot decorators, the number reported for \
"Memory after slot objects creation" is proportional to the number of SlotObject \
instances created, which is why I'd assumed memory had leaked, but I could certainly \
be thinking through things wrong.</span></em><br data-mce-bogus="1"></div><div><br \
data-mce-bogus="1"></div><div>I would like to know how the story ends. Is this an \
actual memory leak? Or is it *just* the Python interpreter keeping the unused memory \
to itself?<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div>I've \
got some more questions regarding properly "destroying" QtObject()s and their \
signals. If you have time, please have a look here: <a \
href="https://stackoverflow.com/questions/65953772/will-the-following-code-disconnect- \
all-incoming-or-outgoing-pyqt-signals">https://stackoverflow.com/questions/65953772/will-the-following-code-disconnect-all-incoming-or-outgoing-pyqt-signals</a><br \
data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div>Thank you very much \
:-)<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div>Kind \
regards,<br data-mce-bogus="1"></div><div>Kristof<br \
data-mce-bogus="1"></div></div></body></html>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic