Just an additional observation: using this code in the timer callback as an
alternative also causes a memory blow-up:

        img = QtGui.QImage('tiger.png')
        buf = QtCore.QBuffer()
        img.save(buf, "BMP")
        pxmp = QtGui.QPixmap()
        pxmp.loadFromData(buf.buffer(), "BMP")
        self.lbl.setPixmap(pxmp)

Ranen


On Fri, Mar 18, 2011 at 3:45 PM, Ranen Ghosh <[email protected]> wrote:

> Hi, I am noticing a memory leak with PySide's QPixmap.fromImage static
> method.
> Here is a small example program to demonstrate it:
> http://pastebin.com/VmKncUFY
>
> For the first 30 seconds or so, everything seems fine.  At that point, my
> Xorg process's memory usage starts to shoot up at about 20M per second.
>
> The following info may be helpful:
>
> If I use the QPixmap's constructor with the filename as an argument, rather
> than using the static QPixmap.fromImage method, I don't observe the memory
> issue.
>
> If I don't call self.lbl.setPixmap(pxmp) , I don't observe the memory
> issue.
>
> If I double the timer delay, it takes roughly twice as long for the memory
> spike to happen.
>
> If I replace PySide with PyQt4 in the import statements, I do not observe
> this memory issue.
>
> Ranen
>
_______________________________________________
PySide mailing list
[email protected]
http://lists.pyside.org/listinfo/pyside

Reply via email to