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

List:       pykde
Subject:    Re: [PyQt] Attempting to reduce the memory footprint of my PyQt5 application
From:       oliver <oliver.schoenborn () gmail ! com>
Date:       2016-09-08 1:48:11
Message-ID: CAMb+DaUP434bUr5jgb-BFDNTK4_DNxsjaQ8852pjm9+wbL+dcw () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


On Wed, Sep 7, 2016, 19:14 Andreas Pakulat <apaku@gmx.de> wrote:

> Hi,
>
> On Wed, Sep 7, 2016 at 11:57 PM, Xavion <xavion.0@gmail.com> wrote:
> > So, you're both saying that the following two lines are equivalent (from
> a
> > memory footprint standpoint):
> >
> > from PyQt5.QtCore import QVariant
> > from PyQt5 import QtCore
> >
> > In other words, in both cases, the whole of 'QtCore' will be imported
> > (rather than just 'QVariant' in the first case).


That is correct and same for all python packages/modules not just pyqt

> Florian: I think you're saying that I can reduce the memory usage by doing
> > the following...
> >
> > from PyQt5 import QtCore
> > mVariant = QtCore.QVariant
> > del QtCore
>

Python modules can be unloaded this way but I don't think a DLL gets
unloaded from memory once it is no longer in use by an app. But even if
there was code in the Python interpreter to unload a DLL it would not get
used because the above code will still be holding a reference to a symbol
that is defined in the DLL so the DLL will not be considered unlovable.

Why are you so concerned with memory occupied by modules?

[Attachment #5 (text/html)]

<br><br><div class="gmail_quote"><div dir="ltr">On Wed, Sep 7, 2016, 19:14 Andreas \
Pakulat &lt;<a href="mailto:apaku@gmx.de">apaku@gmx.de</a>&gt; \
wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 \
.8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br> <br>
On Wed, Sep 7, 2016 at 11:57 PM, Xavion &lt;<a href="mailto:xavion.0@gmail.com" \
target="_blank">xavion.0@gmail.com</a>&gt; wrote:<br> &gt; So, you&#39;re both saying \
that the following two lines are equivalent (from a<br> &gt; memory footprint \
standpoint):<br> &gt;<br>
&gt; from PyQt5.QtCore import QVariant<br>
&gt; from PyQt5 import QtCore<br>
&gt;<br>
&gt; In other words, in both cases, the whole of &#39;QtCore&#39; will be \
imported<br> &gt; (rather than just &#39;QVariant&#39; in the first \
case).</blockquote></div><div><br></div><div>That is correct and same for all python \
packages/modules not just pyqt  </div><div \
class="gmail_quote"></div><div><br></div><div class="gmail_quote"><blockquote \
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex"> &gt; Florian: I think you&#39;re saying that I can reduce \
the memory usage by doing<br> &gt; the following...<br>
&gt;<br>
&gt; from PyQt5 import QtCore<br>
&gt; mVariant = QtCore.QVariant<br>
&gt; del QtCore<br></blockquote></div><div><br></div><div>Python modules can be \
unloaded this way but I don&#39;t think a DLL gets unloaded from memory once it is no \
longer in use by an app. But even if there was code in the Python interpreter to \
unload a DLL it would not get used because the above code will still be holding a \
reference to a symbol that is defined in the DLL so the DLL will not be considered \
unlovable.  </div><div><br></div><div>Why are you so concerned with memory occupied \
by modules?  </div>


[Attachment #6 (text/plain)]

_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
https://www.riverbankcomputing.com/mailman/listinfo/pyqt

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

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