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 |
492559,2 | PdfMultiPageView: don't force TableView to rebuild from scratch on zoom | dev | qt/qtwebengine | Status: MERGED | +2 | 0 |
492947,2 | PdfMultiPageView: don't force TableView to rebuild from scratch on zoom | 6.5 | qt/qtwebengine | Status: MERGED | +2 | 0 |
492948,2 | PdfMultiPageView: don't force TableView to rebuild from scratch on zoom | 6.6 | qt/qtwebengine | Status: MERGED | +2 | 0 |
496436,11 | WIP debug QQuickPixmap cache behavior; leak check | dev | qt/qtdeclarative | Status: ABANDONED | -2 | 0 |
498096,3 | QtPdf: Fix memory leaks | dev | qt/qtwebengine | Status: MERGED | +2 | 0 |
498339,2 | Fix memory leak of QQuickPixmapData instances | dev | qt/qtdeclarative | Status: ABANDONED | -1 | 0 |
499172,2 | fix leak: release more | dev | qt/qtdeclarative | Status: ABANDONED | 0 | 0 |
499520,3 | Ensure that QQuickPixmapReply::finished() can't be emitted until after connect() | dev | qt/qtdeclarative | Status: ABANDONED | 0 | 0 |
499521,3 | queued connection in case it wasn't | dev | qt/qtdeclarative | Status: ABANDONED | 0 | 0 |
499522,7 | Avoid unsigned->signed refCount conversion underflow | dev | qt/qtdeclarative | Status: MERGED | +2 | 0 |
499523,5 | Add and use QQuickPixmapData::key(); track QQuickPixmapData age | dev | qt/qtdeclarative | Status: ABANDONED | 0 | 0 |
500240,9 | Fix memory leak in qquickpixmapcache | dev | qt/qtdeclarative | Status: MERGED | +2 | 0 |
500431,2 | Avoid unsigned->signed refCount conversion underflow | 6.6 | qt/qtdeclarative | Status: MERGED | +2 | 0 |
500432,2 | Avoid unsigned->signed refCount conversion underflow | 6.5 | qt/qtdeclarative | Status: MERGED | +2 | 0 |
500436,2 | QtPdf: Fix memory leaks | 6.5 | qt/qtwebengine | Status: MERGED | +2 | 0 |
500437,2 | QtPdf: Fix memory leaks | 6.6 | qt/qtwebengine | Status: MERGED | +2 | 0 |
500438,1 | QtPdf: Fix memory leaks | 6.2 | qt/qtwebengine | Status: ABANDONED | 0 | 0 |
500693,10 | Test QQuickPixmap::loadImageFromDevice() | dev | qt/qtdeclarative | Status: MERGED | +2 | 0 |
500831,3 | Fix memory leak in qquickpixmapcache | 6.6 | qt/qtdeclarative | Status: MERGED | +2 | 0 |
500832,4 | Fix memory leak in qquickpixmapcache | 6.5 | qt/qtdeclarative | Status: MERGED | +2 | 0 |
500840,1 | Fix memory leak in qquickpixmapcache | tqtc/lts-6.2 | qt/tqtc-qtdeclarative | Status: DEFERRED | 0 | 0 |
500865,7 | Export QQuickPixmapKey and (renamed) QQuickPixmapCache for autotests | dev | qt/qtdeclarative | Status: MERGED | +2 | 0 |
500998,1 | WIP Export QQuickPixmapKey and QQuickPixmapStore for autotests only | 6.5 | qt/qtdeclarative | Status: ABANDONED | -2 | 0 |
500999,1 | WIP Test QQuickPixmap::loadImageFromDevice() | 6.5 | qt/qtdeclarative | Status: ABANDONED | -2 | 0 |
511369,1 | WIP Fix memory leak in qquickpixmapcache | tqtc/lts-5.15.12 | qt/tqtc-qtdeclarative | Status: ABANDONED | -2 | 0 |