Results 1 to 2 of 2

Thread: QT4 debug mode output / QList: Out of memory

  1. #1
    Join Date
    May 2006
    Posts
    788
    Thanks
    49
    Thanked 48 Times in 46 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default QT4 debug mode output / QList: Out of memory

    I have a xml file setting app.. (portable) and i load this file to..

    Qt Code:
    1. typedef QMap<QString, QString> Appsetting;
    2.  
    3. Appsetting OneVar;
    4.  
    5. QStringList varioarg;
    6. varioarg.clear();
    7. QString variablelist = Global_Config_Base("allname",APPLICATION_SETTING);
    8. varioarg = variablelist.split("|");
    9. QStringListIterator o(varioarg);
    10. while (o.hasNext()) {
    11. QString variablename = o.next();
    12. QString valorsi = Global_Config_Base(variablename,APPLICATION_SETTING);
    13. OneVar[variablename] = valorsi;
    14. qDebug() << "### variablename " << variablename << " = " << OneVar[variablename];
    15. }
    16. /* usage from 2 dbs ? */
    17. if (OneVar["usedb2"] == "1") {
    18. usedb2 = true;
    19. } else {
    20. usedb2 = false;
    21. }
    To copy to clipboard, switch view to plain text mode 

    can this produce a ....?

    QList: Out of memory

    30 variable name/value...

    on run....
    Qt Code:
    1. ############ Preload go2............. ######
    2. ############ Preload go3............. ######
    3. master connect ok
    4. ############ Panel building start aa ###### true
    5. ############ Panel building start bb ###### true
    6. QList: Out of memory
    To copy to clipboard, switch view to plain text mode 

    and app crash..

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: QT4 debug mode output / QList: Out of memory

    can this produce a ....?
    QList: Out of memory
    Yes, if you are using a large amount of data it can, since you are allocating on the stack.
    Allocate everything in the section you posted on the heap (and don't forget to clean up).
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

Similar Threads

  1. Unable to execute in Debug Mode
    By Kapil in forum Installation and Deployment
    Replies: 38
    Last Post: 5th April 2006, 07:27

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.