Memory problems using Qt 5.7



  • I am porting a QT 5.2 application using Qt Quick to QT 5.7. The compiler I use is MinGw ( so 32 bits). At first I ran into memory problems using QPluginLoader (in debug code) . Basically it couldnt allocate a single block of memory for the whole plugin. MinGw's debug code increases the size of the plugin immensly so memory fragmentation prevented loading the whole plugin at once, something QT does with plugins. Effect a bad_alloc and no sigar.
    I worked around this by dumping the QPluginLoader which resolved these kind of problems. Unofrtunately this moved the problem to QT itself ( at least QT Quikck) for now I get :
    plugin cannot be loaded for module "QtQuick.Controls": Cannot load library ..\qtquickcontrolsplugind.dll: Not enough storage is available to process this command

    Looking at the source of qt, the problem is identical. The MinGw debug plugins of qtquick are quite large and use the same mechanism to load plugins. If, as in my case, the initialization of the program allocates considerable memory ( but tbh, not excesively so, there is plenty left) QT (and by extension QT quick) can run into problems; in debug mode, using MinGw. This wasnt the case in 5.2 so I must assume that code of loading plugins was changed in between.

    Solutions:
    Switch to a different compiler. As far as I know MSVC allocates much of its debug stuff outside the dll, keeping the dll's bigger as a release but not 20 to 50 times as big as MinGw does. This should give the plugin loader an easier time
    Switch to 64 bits as memory fragmentation is less a problem there.
    Initialize and load all needed qt plugins before doing anything myself. My code is smart enough to deal with memory fragmentation while (it seems) QT's code isnt, at least not for plugins.

    Why do I bring it up here?
    Well first of all, if my conclusions are correct, it seems to me a flaw in the loading mechanisms for plugins. All solutions are dodging the problem but it still is there.
    It was sugested that I pose this question to a developers list but I dont have access to that. This is more a observation/warning for those that encounter these kind of problems.


  • Lifetime Qt Champion

    Hi,

    Related to the developer list, maybe a silly question but: did you subscribe to the list before posting the email ?



  • tried to subscribe (twice) but never got a reply to that


  • Lifetime Qt Champion

    No activation email sent ?



  • @SGaist Indeed


  • Lifetime Qt Champion

    Where did you try to do the subscription ?



  • I followed the link you gave in another post : http://lists.qt-project.org/mailman/listinfo/interest. Tried to subscribe; no reply. Few days later tried again. Same result.


  • Lifetime Qt Champion

    Pretty strange. You should have received an activation email right away.

    Maybe @tekojo knows if there's been something messing up with mailing lists setup.


  • administrators

    Hi,
    Haven't heard of anything, but will ask the admins.
    And then a stupid question, the activation mail isn't in the spam filter?



  • I will recheck (thought I did, not 100% certain). Anyway will try a subcribe again. We will see :)



  • ok problem solved ( the subscription that is). It did not ended up in spam or in my regular mail box but in a mail box for advertisements ( haven't a clue why it would end up there).


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.