[PySide] QImage: out of memory, returning null image

John Ehresman jpe at wingware.com
Wed Jun 5 18:51:18 CEST 2013


On 6/5/13 10:18 AM, William Dias wrote:
> I let the program running yesterday and when the problem arose, the
> process was using 125Mb of memory, according to Windows Resource
> Monitor, while the system had 823Mb of memory in standby and 71Mb of
> free memory. So, apparently, the system is not out of memory, right?

I don't think the system is out of memory.  Could your application be
asking for a huge image due to using bogus height or width values?  If
you're able to run in a C++ debugger, you could set up a breakpoint
that's triggered when the error message is printed and then inspect the
stack.

You could also look in general Qt forums / lists to see what other
conditions could cause this.  The error message is coming from the Qt
libraries so there's a good chance that the problem isn't PySide
specific.  Google returns a number of hits when searching on "QImage:
out of memory, returning null image", though some / most of the
responses are just to look for memory leaks.

I wonder if some other resource (video memory, GDI handles, etc) is
being exhausted and it's being misreported as out of memory.  It may be
worth it to make sure that your code isn't holding on to references to
old objects and to try to explicitly run the garbage periodically via
gc.collect()

Cheers,

John




More information about the PySide mailing list