Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
QT plugins memory footprint and the debugger
I am (trying) to upgrade a qtquick application from qt 5.2 to qt 5.7. Now I am running in a bit unexpected problem. The application is quite large and contains 10+ modules that use the QTPluginLoader mechanism to load its functionality. It worked fine under 5.2 but under 5.7 I get memory issues when loading the plugins. Smaller plugins load fine, bigger ones bug out with a bad_alloc. Now I am using the MingGW compiler and this generates debug plugins which can grow quite big, 50+ Mb. Note that the problem disappears when I shrink the size of a plugin (removing functionality) and is happening purely in the qt code. I traced it down to the attempt of the pluginloader to read the whole plugin at once in one chunck of memory at which point it (can) generates a bad_alloc.
Of course I can split up my plugins but I was wondering if this is a real limitation or that I have to search elsewhere for the cause of this problem
Hi and welcome to devnet,
Interesting question. Since it's bit lower level, I'd recommend bringing this to the interest mailing list. You'll find there Qt's developers/maintainers. This forum is more user oriented.
@SGaist I will do that
which can grow quite big, 50+ Mb
I'd bet my head you have tons of resources inside those. That is enormous, the whole of the QtCore or the QtGui is that size. My advice - reduce the plugins' size. Compile the resources as external files and not into the binary.
Its the way MIngw creates its debug code. It puts it inside the the dll making it 20 times(or more) bigger then a release version. The relevant dll's (that causes a problem) have in fact no resources. It is pure algorithms. MS puts the bulk of debug stuff outside the dll making its size more managable.