Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Memory leak in QML example project
QtWS25 Last Chance

Memory leak in QML example project

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
qmlvalgrindmemory leakc++ qmlqt5.12.x
6 Posts 3 Posters 1.4k Views
  • 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.
  • V Offline
    V Offline
    vicky_mac
    wrote on last edited by vicky_mac
    #1

    Hi,

    I have craeted simple one page qml project with all static components still valgrind shows memory leaks in QML and other qt libraries.

    So, i tried to run the valgrind in given QML example projects and there also i found memory leak issue.

    I ran qmlaxes example code and here are the valgrind run summary:

    ==32578== HEAP SUMMARY:
    ==32578==     in use at exit: 7,588,523 bytes in 54,405 blocks
    ==32578==   total heap usage: 477,543 allocs, 423,138 frees, 69,152,459 bytes allocated
    
    ==32578== LEAK SUMMARY:
    ==32578==    definitely lost: 376 bytes in 16 blocks
    ==32578==    indirectly lost: 32 bytes in 1 blocks
    ==32578==      possibly lost: 196,416 bytes in 1,545 blocks
    ==32578==    still reachable: 7,309,067 bytes in 52,169 blocks
    ==32578==                       of which reachable via heuristic:
    ==32578==                         length64           : 4,960 bytes in 82 blocks
    ==32578==                         newarray           : 107,688 bytes in 92 blocks
    ==32578==         suppressed: 0 bytes in 0 blocks
    ==32578==
    ==32578== For lists of detected and suppressed errors, rerun with: -s
    ==32578== ERROR SUMMARY: 1074 errors from 1069 contexts (suppressed: 0 from 0)
    

    I am using QT5.12.12

    sierdzioS 1 Reply Last reply
    0
    • V vicky_mac

      Hi,

      I have craeted simple one page qml project with all static components still valgrind shows memory leaks in QML and other qt libraries.

      So, i tried to run the valgrind in given QML example projects and there also i found memory leak issue.

      I ran qmlaxes example code and here are the valgrind run summary:

      ==32578== HEAP SUMMARY:
      ==32578==     in use at exit: 7,588,523 bytes in 54,405 blocks
      ==32578==   total heap usage: 477,543 allocs, 423,138 frees, 69,152,459 bytes allocated
      
      ==32578== LEAK SUMMARY:
      ==32578==    definitely lost: 376 bytes in 16 blocks
      ==32578==    indirectly lost: 32 bytes in 1 blocks
      ==32578==      possibly lost: 196,416 bytes in 1,545 blocks
      ==32578==    still reachable: 7,309,067 bytes in 52,169 blocks
      ==32578==                       of which reachable via heuristic:
      ==32578==                         length64           : 4,960 bytes in 82 blocks
      ==32578==                         newarray           : 107,688 bytes in 92 blocks
      ==32578==         suppressed: 0 bytes in 0 blocks
      ==32578==
      ==32578== For lists of detected and suppressed errors, rerun with: -s
      ==32578== ERROR SUMMARY: 1074 errors from 1069 contexts (suppressed: 0 from 0)
      

      I am using QT5.12.12

      sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      @vicky_mac Where and what is leaking?

      In any case, Qt 5.12 is long past its support period. It will not be fixed for sure.

      (Z(:^

      V 1 Reply Last reply
      0
      • sierdzioS sierdzio

        @vicky_mac Where and what is leaking?

        In any case, Qt 5.12 is long past its support period. It will not be fixed for sure.

        V Offline
        V Offline
        vicky_mac
        wrote on last edited by
        #3

        @sierdzio I getting definitely lost leaks in
        libfontconfig.so.1.12.0
        libQt5Quick.so.5.12.12
        libQt5Qml.5.12.12

        Stack trace start from:
        malloc (vg_replace_malloc.c:431)
        calloc (vg_replace_malloc.c:1554)
        operator new(unsigned long) (vg_replace_malloc.c:472)
        respectively and ends at libs

        sierdzioS 1 Reply Last reply
        0
        • V vicky_mac

          @sierdzio I getting definitely lost leaks in
          libfontconfig.so.1.12.0
          libQt5Quick.so.5.12.12
          libQt5Qml.5.12.12

          Stack trace start from:
          malloc (vg_replace_malloc.c:431)
          calloc (vg_replace_malloc.c:1554)
          operator new(unsigned long) (vg_replace_malloc.c:472)
          respectively and ends at libs

          sierdzioS Offline
          sierdzioS Offline
          sierdzio
          Moderators
          wrote on last edited by
          #4

          Valgrind always reports leaks in font config (that library is not part of Qt).

          Regarding Qt libs - these might be false positives, but if not you can check some newer version of Qt.

          (Z(:^

          V 1 Reply Last reply
          0
          • sierdzioS sierdzio

            Valgrind always reports leaks in font config (that library is not part of Qt).

            Regarding Qt libs - these might be false positives, but if not you can check some newer version of Qt.

            V Offline
            V Offline
            vicky_mac
            wrote on last edited by
            #5

            @sierdzio Thnx for you reply.

            These memory leaks causing the application memory consumption grow over time.
            Is there anyway we can prevent that?

            upgrading may not be possible for me, though i'll try for newer version if possible.

            JonBJ 1 Reply Last reply
            0
            • V vicky_mac

              @sierdzio Thnx for you reply.

              These memory leaks causing the application memory consumption grow over time.
              Is there anyway we can prevent that?

              upgrading may not be possible for me, though i'll try for newer version if possible.

              JonBJ Offline
              JonBJ Offline
              JonB
              wrote on last edited by JonB
              #6

              @vicky_mac said in Memory leak in QML example project:

              Is there anyway we can prevent that?

              No, as already replied in your other thread asking exactly the same, which you have not referenced from this topic. But you can keep asking the same. Or, you can look through the source code, find the exact point of the leak you claim, and fix it.

              Apologies, that was https://forum.qt.io/topic/152049/stackview-is-cause-of-memory-leak, you do not seem to be the same author, though they look similar.

              I also notice you are using Qt 5.12. Qt Company is not going to be addressing anything in that version.

              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