Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. qBadAlloc - strange problem
Forum Updated to NodeBB v4.3 + New Features

qBadAlloc - strange problem

Scheduled Pinned Locked Moved General and Desktop
12 Posts 3 Posters 3.5k Views 3 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    LuGRU
    wrote on last edited by
    #3

    I run with debugger that's why I know that application crashes in QByteArray realloc function and when allocating more memory fails it do crash.

    This part of code is used to compress data to ZIP file. It's not stream base that's why usage is so high.

    But reall question is why same code (nothing was changed) crashed in debug mode and after closing Firefox and again rerunning application in debug mode problem is resolved.

    Not only that - in application I do have 2 ways to save file to ZIP and using "other" way did work for large file but when used "first" mode it did crash (didn't crash on other PC with WIn 8.1 / Mac 10.10 - run also in debug mode).

    I know that my description is vague but I'm working on large application and I can't go into details here.

    Another question - could to much recursive calls cause throw of qBadAlloc() ?

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #4

      Hi,

      Did you check the available memory on your computer when FireFox was running ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • L Offline
        L Offline
        LuGRU
        wrote on last edited by
        #5

        Yes, there was plenty of free memory.
        Also I performed test - closing Firefox and recreating opened tabs - no issue.

        1 Reply Last reply
        0
        • L Offline
          L Offline
          LuGRU
          wrote on last edited by
          #6

          Theory - I will need to test this out but I'm suspecting that issue is related to manually set "Virtual Memory" on system.
          Tested on other applications (many Firefox tabs, memory intense application) and apps did crash - although in event viewer I don't see any crash related to memory per say but this may be a case here).

          1 Reply Last reply
          0
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #7

            How are you modifying the virtual memory handling on your computer ?

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            0
            • L Offline
              L Offline
              LuGRU
              wrote on last edited by
              #8

              Like this: http://windows.microsoft.com/en-us/windows/change-virtual-memory-size#1TC=windows-7

              1 Reply Last reply
              0
              • SGaistS Offline
                SGaistS Offline
                SGaist
                Lifetime Qt Champion
                wrote on last edited by
                #9

                Are you increasing or decreasing the available Virtual Memory ?

                Interested in AI ? www.idiap.ch
                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                1 Reply Last reply
                0
                • L Offline
                  L Offline
                  LuGRU
                  wrote on last edited by
                  #10

                  I tried both - now I cant reproduce issue.

                  When issue with qBadAlloc() occured virtual was set to "automatic" - so no limitation's issue.

                  At this point I'm out of ideas. Now application works perfectly fine - with no code change.

                  1 Reply Last reply
                  0
                  • SGaistS Offline
                    SGaistS Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on last edited by
                    #11

                    Then there's only one answer: gremlins...

                    Interested in AI ? www.idiap.ch
                    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                    1 Reply Last reply
                    0
                    • L Offline
                      L Offline
                      LuGRU
                      wrote on last edited by
                      #12

                      Unfortunately no gremlins here, just trolls :D

                      I run some more test and nothing come up so I can't explain why application do crash for same input data but memory do spikes to much so I'm redesigning some mem intensive parts.

                      Thanks for the input.

                      1 Reply Last reply
                      0

                      • Login

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • Users
                      • Groups
                      • Search
                      • Get Qt Extensions
                      • Unsolved