Details
-
Bug
-
Resolution: Incomplete
-
P2: Important
-
None
-
5.15.16, 6.6.3, 6.7.0
Description
- QNetworkDiskCache consumes a larger size of memory comparing to the file size to download. Qt 6 uses almost double of the down load file size.
- Even when using the cached data, QNetworkDiskCache uses a larger size of memory than the download file size.
- A user thinks this memory consumption is larger than his expectation considering it is using the cached data on the disk, and he is wondering if this is expected behavior or not. He is pointing out that is caused by the following part of code where the application tries to read all data from the cache into the buffer :
https://codebrowser.dev/qt5/qtbase/src/network/access/qnetworkdiskcache.cpp.html#418
How to reproduce the issue:
Run the attached reproducer (untitled14). The application tries to download a linux ISO image, which is 409 MB in size, with using QNetworkDiskCache.
With Qt 5.15.16, during the first download, the size of memory used by the application was increasing, and it reached up to 454.3 MB when the download was finished.
For the second run, the download was finished in a moment due to the cache, and the size of memory used was 415.8 MB.
With Qt 6.6.3, the size of memory used for the first download reached up to 884.9 MB when the download was finished.
For the second run, the download was finished in a moment, and the application used 517.5 MB memory.
With Qt 6.7.0, the size of memory used for the first download reached up to 887.1 MB when the download was finished.
For the second run, the download was finished in a moment, and the sapplication used 519.3 MB memory.
The memory sizes above were checked via Windows Task Manager.