Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-78101

Possible memory leak when modifying geometry

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 5.12.4
    • Qt3D
    • None
    • macOS

    Description

      We have a desktop CAD app with a custom loader. This issue happens when loading a mesh, which is made of two entities comprised of thousands of triangles and then the user translates (moves) the mesh, which is implemented by modifying and updating the geometry data.

      For example:

      1. Load mesh (has an entity for triangles, and another entity to simulate quadrilaterals using triangles), don’t do anything: Consumes ~ 2.1 GB.
      2. Translate it 5 times and then exit: Rises up to 3.2 GB.

      The number of translations might not matter, i.e. this seeming doubling in QByteArray memory happens after the first translation.

      The issue here is that we do not allocate anything new for this. We keep the original QByteArray, for instance, so we can simply update the vertices (and keep the normals) when translating. The index array is not touched. The only items that are touched are the two QByteArrays that are passed into the Qt3DRender::QBuffer (via updateData()). Their sizes are 372,579,048 and 2,286,936 bytes, respectively. It would seem that perhaps there are extra QByteArray copies left in memory.

      Notes: Memory measured via MacOS Activity Monitor. Htop provided similar (slightly higher) numbers.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            seanharmer Sean Harmer
            skenyon Sam Kenyon
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes