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. Memory usage spike with Qt3D
Qt 6.11 is out! See what's new in the release blog

Memory usage spike with Qt3D

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 2 Posters 1.1k Views 2 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.
  • JohanSoloJ Offline
    JohanSoloJ Offline
    JohanSolo
    wrote on last edited by
    #1

    Dear all,

    in one of the software I'm responsible, I'm trying to get rid of an outdated version of 3D visualisation library and would like to use Qt3D to do the job.
    I started with a simple (at least that's what I though) application: points in space are generated and their colour should change according to some criteria. Before I used 2 projections and QGraphicsView to represent the data.
    I am on Windows 10, using MSVC 2013 with Qt 5.6.2 64bits.
    For each generated points I use a spherical mesh (the same for each point), set the material and transformation. The thing I see is that for about 1300 points the memory usage for the application goes up to something like 2 GB, but after a while it goes down to something like 80 MB!

    I could imagine 1300 meshes are a lot, this is why I only use 1 instance of QSphereMesh and QPhongMaterial (I only use 1 colour at this stage) which are used by my 1300 QEntity instances, and I reduced the spherical mesh quality (anyway they will be looked at from far away). But still I find a bit odd that the memory behaves like this.

    Is this normal? If yes, is there smarter way of coding this in order to reduce the initial memory usage?

    Please find a test project illustrating the aforementioned behaviour:
    .pro file
    Windows.h
    Windows.cpp
    mainwindow.h
    mainwindow.cpp
    main.cpp

    `They did not know it was impossible, so they did it.'
    -- Mark Twain

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

      Hi,

      If possible, try with the latest LTS: 5.9. There's work that has been done to improve both CPU and memory consumption.

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

      JohanSoloJ 2 Replies Last reply
      1
      • SGaistS SGaist

        Hi,

        If possible, try with the latest LTS: 5.9. There's work that has been done to improve both CPU and memory consumption.

        JohanSoloJ Offline
        JohanSoloJ Offline
        JohanSolo
        wrote on last edited by
        #3

        @SGaist said in Memory usage spike with Qt3D:

        Hi,

        If possible, try with the latest LTS: 5.9. There's work that has been done to improve both CPU and memory consumption.

        I'll give a try and let you know. Thing is the Qt3D part seems not to be compatible (as far as I've seen) between 5.6.2 and 5.9.1

        `They did not know it was impossible, so they did it.'
        -- Mark Twain

        1 Reply Last reply
        0
        • SGaistS SGaist

          Hi,

          If possible, try with the latest LTS: 5.9. There's work that has been done to improve both CPU and memory consumption.

          JohanSoloJ Offline
          JohanSoloJ Offline
          JohanSolo
          wrote on last edited by
          #4

          @SGaist You've just made my day!
          Now the scene is rendered immediately and memory an initialisation is about 180 MB for ~1300 meshes.

          `They did not know it was impossible, so they did it.'
          -- Mark Twain

          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