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. QOpenGLWidget GPU memory leak
Forum Updated to NodeBB v4.3 + New Features

QOpenGLWidget GPU memory leak

Scheduled Pinned Locked Moved Solved General and Desktop
2 Posts 1 Posters 409 Views 1 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.
  • L Offline
    L Offline
    ligazetom
    wrote on 22 Apr 2020, 11:21 last edited by ligazetom
    #1

    Hello,

    I have QTabWidget setup so everytime I push button, it creates new tab with QOpenGLWidget inside. Nothing else.

    First tab, memory usage jumps from 12MB to 336 MB then after a while goes down to 180 MB. Each new tab adds around 30 MB.

    If I click four times I will have four tabs, each with its own QOpenGLWidget instance taking up around 270MB.

    Now if I destroy ALL tabs memory goes UP! to 414MB and stays there. This is ALL VRAM.

    First of all, even if I was not deleting QOpenGLWidgets, I see no reason for the memory usage to go up.
    Second, I DO delete them.

    To reproduce: Create project with MainWindow and TabWidget inside and some trigger event (PushButton or action etc.)
    And Implement two methods.

    void Project::on_actionOpen_triggered()
    {
    	ui->tabWidget->addTab(new QOpenGLWidget, "Tab");
    }
    
    void Project::on_tabWidget_tabCloseRequested(int tabId)
    {
    	QOpenGLWidget *vw = static_cast<QOpenGLWidget*>(ui->tabWidget->widget(tabId));
    	vw->deleteLater();
    }
    

    That's it.

    Windows 10 Pro
    QT 5.14.1
    Visual Studio 2017

    I can see memory usage in VS Profiling tools as well as in Task Manager.

    1 Reply Last reply
    0
    • L Offline
      L Offline
      ligazetom
      wrote on 22 Apr 2020, 13:45 last edited by
      #2

      TabWidget::Clear() does not emit close request....

      1 Reply Last reply
      0

      1/2

      22 Apr 2020, 11:21

      • Login

      • Login or register to search.
      1 out of 2
      • First post
        1/2
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved