[okular] [Bug 388854] Okular uses a very large amount of RAM for caching

Tobias Deiminger bugzilla_noreply at kde.org
Tue Jul 3 23:51:29 UTC 2018


https://bugs.kde.org/show_bug.cgi?id=388854

--- Comment #35 from Tobias Deiminger <haxtibal at posteo.de> ---
(In reply to Albert Astals Cid from comment #34)
> That code is only used if you have QT_XCB_NATIVE_PAINTING environment
> variable set that i hope you're not since it's experimental
The variable wasn't set. So QPixmap didn't delegate to QX11PlatformPixmap, but
to QRasterPlatformPixmap.

> I can't find memory chunks large enough to hold contiguous range
> of memory for page bitmaps

Now I know why heap didn't contain expected chunks. The inner objects of
PagePrivate::PixmapObject::m_pixmap were NOT in heap, but on stack.

@Albert: As I understand, the Page QPixmap is meant to live long. Is this
correct? If yes, we have a bug here, because stack memory of course doesn't
live long. 

That's what I did, maybe someone can repeat it for confirmation.

void PagePrivate::setPixmap( DocumentObserver *observer, QPixmap *pixmap, const
NormalizedRect &rect, bool isPartialPixmap )
{
    if ( m_rotation == Rotation0 ) {
        // ...
        QMap< DocumentObserver*, PagePrivate::PixmapObject >::iterator it =
m_pixmaps.find( observer );
        // ...
        it.value().m_pixmap = pixmap;  // break here, and observe inner objects
of QPixmap* pixmap
        // ...
    }
}

(gdb) b page.cpp:557
Breakpoint 1 at 0x7fffdac68109: file /home/deiminge/git/okular/core/page.cpp,
line 557.
(gdb) c
Thread 1 "okular" hit Breakpoint 1, Okular::PagePrivate::setPixmap
(this=0x555555d2a610, observer=0x555555a46ee0, pixmap=0x555555df9d60, rect=...,
isPartialPixmap=0x0) at /home/deiminge/git/okular/core/page.cpp:557
557             it.value().m_pixmap = pixmap;
(gdb) p *pixmap
$1 = {
...
  members of QPixmap: 
  data = {
    d = 0x555555d21950
  }
}
(gdb) p *(QRasterPlatformPixmap*)0x555555d21950 $2 = {
...
members of QRasterPlatformPixmap:
  image = {
    members of QImage:
    d = 0x7fffc00100d0
  }
}
(gdb) p *(QImageData*)0x7fffc00100d0
$9 = {
...
  width = 0x4f9, 
  height = 0x673, 
  depth = 0x20, 
  nbytes = 0x80476c, 
  devicePixelRatio = 1, 
...
  data = 0x7fffc6093010  // Here's the large raw pixmap
                         // 0x7fff... is in my stack memory range
...
}

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the Okular-devel mailing list