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 17 Oct 2023, 11:26 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

    S 1 Reply Last reply 18 Oct 2023, 05:51
    0
    • V vicky_mac
      17 Oct 2023, 11:26

      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

      S Offline
      S Offline
      sierdzio
      Moderators
      wrote on 18 Oct 2023, 05:51 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 19 Oct 2023, 04:24
      0
      • S sierdzio
        18 Oct 2023, 05:51

        @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 19 Oct 2023, 04:24 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

        S 1 Reply Last reply 19 Oct 2023, 05:25
        0
        • V vicky_mac
          19 Oct 2023, 04:24

          @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

          S Offline
          S Offline
          sierdzio
          Moderators
          wrote on 19 Oct 2023, 05:25 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 13 Nov 2023, 11:48
          0
          • S sierdzio
            19 Oct 2023, 05:25

            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 13 Nov 2023, 11:48 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.

            J 1 Reply Last reply 13 Nov 2023, 13:13
            0
            • V vicky_mac
              13 Nov 2023, 11:48

              @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.

              J Offline
              J Offline
              JonB
              wrote on 13 Nov 2023, 13:13 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