Bug 351053 - Okular Memory leak
Summary: Okular Memory leak
Status: RESOLVED NOT A BUG
Alias: None
Product: okular
Classification: Applications
Component: general (show other bugs)
Version: 0.21.3
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: Okular developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-08-07 08:41 UTC by Peter Tselios
Modified: 2017-03-28 22:21 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Screenshot of memory usage (69.91 KB, image/png)
2015-08-07 08:42 UTC, Peter Tselios
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Tselios 2015-08-07 08:41:55 UTC
Ocular safer from memory leaks. Due to my job, I need to keep Ocular open for a lot of hours, even days. At the time of writing this report, on my openSUSE desktop, Ocular has reserved 750MB of RAM for a document of 1.4MB! Ocular runs for 36 hours. 24 hours ago, at the same time of the day, Ocular had reserved 500MB of RAM. 

Reproducible: Always

Steps to Reproduce:
1. Open a document in Ocular
2. Navigate though the document, as you normally do.
3. Stop reading the document and record memory consumption. 
4. Wait for a few hours and record memory again. You will notice a significant increase. 


Expected Results:  
Memory consumption should stay stable through time.
Comment 1 Peter Tselios 2015-08-07 08:42:49 UTC
Created attachment 93927 [details]
Screenshot of memory usage
Comment 2 Albert Astals Cid 2015-08-10 20:56:06 UTC
So you only ever open one file?
Comment 3 Peter Tselios 2015-08-12 15:52:51 UTC
Only on file open. Due to my job, I need to keep Okular for a lot of time, some times days.
The settings are the defaults. Also, it's indepedent from the file. I tried with 5 different files. Some of them freely available, others, just documents that I had "printed" from LibreOffice. 

I will check with my Fedora 22 (KDE 5) if there is a similar situation.
Comment 4 Peter Tselios 2015-08-13 13:23:30 UTC
(In reply to Peter Tselios from comment #3)
> Only on file open. Due to my job, I need to keep Okular for a lot of time,
> some times days.
> The settings are the defaults. Also, it's indepedent from the file. I tried
> with 5 different files. Some of them freely available, others, just
> documents that I had "printed" from LibreOffice. 
> 
> I will check with my Fedora 22 (KDE 5) if there is a similar situation.

I can verify that it's the same and in KDE 5 with Okular 0.22
Comment 5 Albert Astals Cid 2015-08-16 22:36:44 UTC
There's no such thing as KDE 5, i guess you mean the desktop is Plasma 5, but that makes no difference for Okular itself.

Can you attach any of those files you use to reproduce the problem?

Also what is your pattern of usage? Just leave the file open? Scroll between pages? I.e. what do you exactly do to reproduce the problem?
Comment 6 Peter Tselios 2015-08-19 06:31:12 UTC
I will try to post some files. I cannot post those files that I use daily because they contain sensitive data. 
The pattern is simple: 

 - Open document.
 - Start reading document (usually at Fit Width zoom level)
 - Scroll down Copy text
 - More scroll down
 - At some point stop and move to another open application
 - Return after minutes or hours.
Comment 7 Albert Astals Cid 2015-08-19 22:52:23 UTC
Also you may want to try running okular throught

valgrind --tool=massif okular

And attach the file so we can see the memory evolution pattern
Comment 8 Peter Tselios 2015-08-25 16:40:28 UTC
OK, I will try that in a few days. Do you prefer to do that in KDE 4 or 5?
Comment 9 Albert Astals Cid 2015-08-25 20:35:15 UTC
It doesn't matter if you run Okular in Plasma 4 or Plasma 5.

If possible make sure you have debug symbols installed since that will help in giving more info,
Comment 10 Christoph Feck 2015-09-23 16:28:07 UTC
Peter, any success in running Okular with valgrind memory profiling tools? You might also look at the new heaptrack tool.
Comment 11 Albert Astals Cid 2017-03-28 22:21:28 UTC
No answer for years