Bug 193675 - memory leak in kpdf
Summary: memory leak in kpdf
Status: RESOLVED DUPLICATE of bug 177213
Alias: None
Product: kpdf
Classification: Unmaintained
Component: general (show other bugs)
Version: unspecified
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: Albert Astals Cid
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-05-22 21:05 UTC by Mirek Mieszczak
Modified: 2009-08-27 00:49 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
valgrind log from kpdf session (240.57 KB, application/octet-stream)
2009-05-22 21:08 UTC, Mirek Mieszczak
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mirek Mieszczak 2009-05-22 21:05:04 UTC
Version:           3.5.10 (using KDE 3.5.10)
Compiler:          gcc-4.3.2 
OS:                Linux
Installed from:    Gentoo Packages

When viewing large files in kpdf it leads xorg to use all accessible memory.
After viewing of 100 pages memory usage goes into 500 Megs and more.
Comment 1 Mirek Mieszczak 2009-05-22 21:08:14 UTC
Created attachment 33925 [details]
valgrind log from kpdf session
Comment 2 Pino Toscano 2009-05-22 21:13:26 UTC
KPDF caches the rendered pages internally, using the low-loevel graphics system (X11, in your case). Of course, it retains a policy about it, that you can set in the preferences, "Performance" section.
100 Mb of memory for 50 pages and more it is not that much. How much memory (RAM + swap) do you have in total?
Comment 3 Mirek Mieszczak 2009-05-25 18:48:42 UTC
After some investigation, it seems that even kpdf and okular when viewing pdf files, lead xorg into extremaly high memory usage.
The strange is that this memory is listed by pmap command, but isn't listed when called xrestop at all.
There are examples:

Before opening of okular (just few lines from pmap):

5102:   /usr/bin/X -br -novtswitch -quiet -nolisten tcp :0 vt7 -auth /var/run/xauth/A:0-Vs1HqS
Address           Kbytes     RSS    Anon  Locked Mode   Mapping                               
0000000000400000    1708       -       -       - r-x--  Xorg                                  
00000000007ab000       8       -       -       - r----  Xorg                                  
00000000007ad000      36       -       -       - rw---  Xorg                                  
00000000007b6000     164       -       -       - rw---    [ anon ]                            
0000000001378000   75008       -       -       - rw---    [ anon ]                            
0000000040a9a000       8       -       -       - rwx--  zero                                  


And after viewing about 200 pages in okular (500 pages long document, 26 MB), the same as above:

5102:   /usr/bin/X -br -novtswitch -quiet -nolisten tcp :0 vt7 -auth /var/run/xauth/A:0-Vs1HqS                                                                        
Address           Kbytes     RSS    Anon  Locked Mode   Mapping                                                                                                       
0000000000400000    1708       -       -       - r-x--  Xorg                                                                                                          
00000000007ab000       8       -       -       - r----  Xorg                                                                                                          
00000000007ad000      36       -       -       - rw---  Xorg                                                                                                          
00000000007b6000     164       -       -       - rw---    [ anon ]                                                                                                    
0000000001378000  634112       -       -       - rw---    [ anon ]                                                                                                    
0000000040a9a000       8       -       -       - rwx--  zero                                                                                                     

As you can see, there is used over 600 MB of memory.
The problem is that this situation lead regularry to extensive usage of SWAP, and the system stay unusable until xorg will be restarted.
Comment 4 Mirek Mieszczak 2009-07-06 21:50:23 UTC
Please mark it as duplicate of bug No 177213
Comment 5 Mirek Mieszczak 2009-07-19 14:40:06 UTC
It seams, that since installation of QT-4.5.2 it is much much better. Memory usage is growing until a defined level, and then stops.
Comment 6 Albert Astals Cid 2009-08-27 00:49:08 UTC

*** This bug has been marked as a duplicate of bug 177213 ***