Details
-
Bug
-
Resolution: Fixed
-
P1: Critical
-
5.15.14, 6.2.8, 6.5.1
-
8787c5329 (dev), ea6970657 (6.5), 7d09b40b7 (6.6), c6cda495c (dev), 8289e5935 (dev), bd0158ff2 (6.6), 62face924 (6.5), 66d7a5b2b (6.6), c871a52f9 (dev), 2b031670c (6.5), 3df72c56e (dev), 2e5632058 (6.6), 31946b66c (6.5), 96e682217 (dev)
Description
Steps to reproduce
- Download this file to disk: https://www.st.com/resource/en/reference_manual/rm0433-stm32h742-stm32h743753-and-stm32h750-value-line-advanced-armbased-32bit-mcus-stmicroelectronics.pdf (it is a 40MB, 3300+ page document)
- Launch a system memory monitoring tool (e.g. Task Manager on Windows, `top` on Linux)
- Launch the PDF Multipage Viewer Example (https://doc.qt.io/qt-6/qtpdf-multipage-example.html )
- Click the "Open" button and open the PDF file downloaded above
- Use the SpinBox to jump to page 3000
- Click the "Zoom In" button 3x
- Click the "Zoom Out" button 3x
- Click the "Open" button and open the "test.pdf" from the example's source folder
Outcomes
Using Qt 6.5.1 on Windows 10 22H2, MSVC 2019 x64, Release build:
Step No. | RAM consumed (GB) |
---|---|
3 | 0.0 |
4 | 0.5 |
5 | 0.5 |
6 | 3.7 → 7.9 → 13.0 |
7 | 17.0 → 17.9 → 18.4 |
8 | 18.4 |
Notes
- For reference, repeating the test above on my dedicated PDF viewer application results in a maximum RAM consumption of 0.2 GB (that's a ~90x difference)
- The magnitude of this problem seems to be proportional to the page number where we perform the zoom. If I change Step #5 to jump to p1000 instead, the RAM consumption is (1.6 → 3.0 → 4.9 GB) while zooming in, and (6.2 → 7.2 → 7.2 GB) while zooming out. Does PdfMultiPageView render everything from the start up to the page that we're on when zooming?
- Step #8 does not release memory. I would've expected it to release most of it.
- With each zoom in the test above, the view jumps by several hundred pages too. I would've expected it to stay on the current page.
Attachments
Issue Links
- duplicates
-
QTBUG-114823 QtPDF Qt5.15.12 Memory Leak
- Closed
- relates to
-
QTBUG-94455 tst_QQuickFileDialogImpl::defaults() leaks memory
- Closed
-
QTBUG-84314 Fix QQuickPixmapCache to cache large images rendered by complex image plugins, and dispose via LRU algorithm
- Closed
-
QTBUG-124607 [Qt PDF] Memory spikes when zooming into a page that contains a raster image
- Reported
-
QTBUG-117429 TIFF AnimatedImage memory leak
- Closed
-
QTBUG-81266 figure out whether QPixmapCache and QQuickPixmapCache can be unified
- Reported
- replaces
-
QTBUG-110597 tst_qquickpixmapcache leaks memory
- Closed
- resulted from
-
QTBUG-22742 QDeclarativePixmapStore does not free all pixmaps
- Closed
-
QTBUG-77506 develop PDF rendering strategy for Qt Quick
- Closed
- resulted in
-
QTBUG-118064 tst_qquickpixmapcache::slowDevice is flaky
- Closed
-
QTBUG-118691 tst_qquickpixmapcache::slowDevice is flaky
- Closed
For Gerrit Dashboard: QTBUG-114953 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
494714,3 | WIP QQuickPixmapData::addToCache(): remove oldest when there are several | dev | qt/qtdeclarative | Status: NEW | -2 | 0 |
496612,1 | WIP Parent QQuickTextureFactory to the QQuickImage that needs it | dev | qt/qtdeclarative | Status: NEW | -2 | 0 |
497740,3 | WIP qquickpixmapcache: Remove pixmaps without refs or texture for too long | dev | qt/qtdeclarative | Status: NEW | -2 | 0 |
498095,2 | Fix memory leak in PDFium's font cache | 112-based | qt/qtwebengine-chromium | Status: NEW | 0 | 0 |
498813,1 | WIP QQuickPixmap::loadImageFromDevice: uncache previous on event | dev | qt/qtdeclarative | Status: NEW | -2 | 0 |
501025,1 | WIP Fix memory leak in qquickpixmapcache | tqtc/lts-5.15 | qt/tqtc-qtdeclarative | Status: NEW | 0 | 0 |