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. Please help: Download file from server using HTTP/2 protocol consumes too much RAM
Qt 6.11 is out! See what's new in the release blog

Please help: Download file from server using HTTP/2 protocol consumes too much RAM

Scheduled Pinned Locked Moved Unsolved General and Desktop
12 Posts 4 Posters 1.5k 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.
  • SGaistS Offline
    SGaistS Offline
    SGaist
    Lifetime Qt Champion
    wrote on last edited by
    #3

    Hi and welcome to devnet,

    Since QNetworkReply is a QIODevice, why not use readyRead and read the data as they arrive ?

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

    K 1 Reply Last reply
    0
    • SGaistS SGaist

      Hi and welcome to devnet,

      Since QNetworkReply is a QIODevice, why not use readyRead and read the data as they arrive ?

      K Offline
      K Offline
      kto_
      wrote on last edited by
      #4

      Hi @SGaist
      Yes, I do use readyRead signal to read data when they arrive. You can check my code above

      QObject::connect(rep, &QNetworkReply::readyRead, [&](){
              // Write data to file
              file.write(rep->readAll());
          });
      
      1 Reply Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #5

        My bad, the code rendering is sometime tricky.

        Even if locked with 5.9.6, can you check if it works better with a more recent version of Qt ?

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

        K 1 Reply Last reply
        0
        • SGaistS SGaist

          My bad, the code rendering is sometime tricky.

          Even if locked with 5.9.6, can you check if it works better with a more recent version of Qt ?

          K Offline
          K Offline
          kto_
          wrote on last edited by
          #6

          Since all my projects are using Qt 5.9.6 so I cannot upgrade to newer version now (it will take time to make everything works fine with recent Qt version).
          I wonder if we have a solution for this (or root cause is ok)

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

            The fact that you are locked to 5.9.6 is well understood, my suggestion is to check whether it's still the case with a more recent version of Qt and if it's the case, you might be able to backport said fix. You do not need to re-build your whole application, just make a minimal app that does the download to observe the effect.

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

            1 Reply Last reply
            1
            • K Offline
              K Offline
              kto_
              wrote on last edited by
              #8

              Got it, let me try.
              Thanks a lot for your help.

              1 Reply Last reply
              0
              • K Offline
                K Offline
                kto_
                wrote on last edited by
                #9
                This post is deleted!
                1 Reply Last reply
                1
                • Christian EhrlicherC Offline
                  Christian EhrlicherC Offline
                  Christian Ehrlicher
                  Lifetime Qt Champion
                  wrote on last edited by
                  #10

                  It still would be nice if you can try to reproduce it with 5.15.x and if it still happens without you start/endTransaction() stuff, create a bug report so it gets fixed. I don't have a http/2 server for testing here so can't try it out by myself.

                  Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                  Visit the Qt Academy at https://academy.qt.io/catalog

                  1 Reply Last reply
                  1
                  • K Offline
                    K Offline
                    kto_
                    wrote on last edited by
                    #11

                    Sorry I forgot to enable HTTP/2. I re-checked again and RAM is still increased.
                    You can test by downloading file from here:
                    https://download-installer.cdn.mozilla.net/pub/firefox/releases/89.0/linux-x86_64/en-US/firefox-89.0.tar.bz2
                    This server is using HTTP/2 protocol.

                    1 Reply Last reply
                    0
                    • T Offline
                      T Offline
                      Thuong Le
                      wrote on last edited by Thuong Le
                      #12

                      I've tried with 5.12 and the problem is not happening. Maybe it is a bug of 5.9.6

                      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