Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QtWebEngine
  4. Freeing all memory of the QWebEngine (and Qt Quick)
QtWS25 Last Chance

Freeing all memory of the QWebEngine (and Qt Quick)

Scheduled Pinned Locked Moved Unsolved QtWebEngine
qwebenginememory leakmodulelinuxqt6
1 Posts 1 Posters 595 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.
  • 2 Offline
    2 Offline
    20Percent
    wrote on 7 May 2023, 18:38 last edited by
    #1

    My app uses around 80MB of RAM, but if I add a webengine it spawns three QtWebEngineProcesses, and the app process's memory usage jumps to 200MB. Simply linking to WebEngineWidgets increases ram use by 30MB, so I made a separate .so that handles the browser side of things and returns an interface I can use to manage the QWebEngineView.

    Loading my library and showing the browser works great. The window does disappear for a bit (as it switches to OpenGL rendering?).

    However, I can't free the memory that the QWebEngineView consumes, along with the processes it spawns and the Qt Quick widget allocations it does. Deleting the QWebEngineView and it's page isn't enough.

    If I dlclose() the library after cleanup, doing anything in the app crashes (maybe because the renderer is not switched back?).

    My cleanup code is as follows:

      webEngineView->setParent(nullptr);
      webEngineView->hide();
      
      webEngineView->page()->deleteLater();
      webEngineView->setPage(nullptr);
    
      webEngineView->close();
    
      delete webEngineView;
    
      webEngineView = nullptr;
    
      //dlclose(dl_handle)
      //dl_handle = nullptr;
    

    How can I switch back the renderer (making the window disappear and reappear)?
    How can I fully kill all QtWebEngineProcesses and free the memory they use?
    How can I free the other memory that is used by the QWebEngineView?

    If it matters:
    I am using Qt6 (6.5.0) on Arch Linux.
    I have an AMD graphics card, using open source (mesa) drivers.

    1 Reply Last reply
    0

    1/1

    7 May 2023, 18:38

    • Login

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