Qt World Summit: Register Today!

Qt QGraphicsScene memory consumption

  • I have application based on QGraphicsScene. I have more then 40k objects on it. And when i'm zoom in and zoom out and move scene i saw that my app use more and more memory(using "top | grep mayApp ").
    Then i take a simple example "Chip" from basic Qt examples. And try to zoom in, zoom out and move. And I get the similar behavior. App Chip eats more and more memory. What does it means ? And how to solve memory consumption issue ?

  • Lifetime Qt Champion

    Hi and welcome to devnet,

    What version of Qt ? What OS ?

    One thing you can do is profile the application using e.g. Valgrind.

  • It's reproduce on Ubunru,RedHat and Windows. Uses Qt 4.8 and Qt 5.5. Valgrind says nothing. But Chip application can eat more then 90mb of memory ease. Start memory usage ~30 mb.

  • Lifetime Qt Champion

    Part of the memory use pattern comes from the number of chip on screen. So if you are showing your window bigger you will also have more chip in the four quadrant.

Log in to reply