Help! Windows QML Image corruption/crash problem
-
I have a large and rambling Windows QML/Javascript/C++ game project that's developed a mysterious and intermittent crash - I'm running out of ideas for what might be causing it, so was hoping that someone here might be able to give me some ideas.
After playing for a while, the game starts displaying corrupted images apparently at random - sometimes these look like noise, sometimes like other images, sometimes like bits of screen texture (e.g. they have text overlaid by the program appearing as part of the image). Eventually program freezes or crashes after these corruption issues become worse. To my mind this smacks of memory corruption. On one occasion at least Windows has reported a graphics-driver crash when the program went down.
Images are simply QML Images as part of compound QML items. Sources are set dynamically using JS (not via C++), and items are loaded dynamically (again via JS). The program is pretty big, and there QML items in existence at any one time
The problem doesn't seem to occur on every machine. I've yet to identify any pattern, but I have one Win7 64 machine on which it occurs, and another on which it doesn't. Graphics driver issues are the obvious suspect, BUT changing from OpenGL to Angle didn't solve anything!
Thing's I've tried without success:
Moving from Qt 5.3 -> 5.4
Moving from MinGW to VCC
Moving from OpenGL to Angle
Moving images out of resource files and into 'plain' filesystemThis MIGHT of course simply be a bug in my code, but if so I would have thought that it would have to be something to do with dynamic creation and destruction of QML items. Careful logging of all such activities reveals no obvious problems - i.e. everything that's created is destroyed, nothing is destroyed that's not created, nothing is destroyed twice.
Has anyone ever come across anything similar, or have any ideas what the problem might be???
Thanks!
-
Solved! In case anyone else runs into this - it was an out-of-memory issue. Seems the Javascript garbage collector, on some machines at least, was not running automatically, or at least not until memory usage approached 2Gb. Inserting timed (and strategic) calls to the JS function gc() keeps memory usage sane, and seems to stop the problem.
-
OK, scratch that, not fixed, but now understood better. Memory management issue is to to with integrated graphics on some laptops - Intel 4000 at least. Destroyed QML items don't seem to free up allocated video RAM. Any idea how to deal with???
-
Hi,
That looks like something you should bring on the interest mailing list. You'll find there Qt's developers/maintainers (this forum is more user oriented)