Bug 394834 - Okular not release memory (ram) taken by closed documents
Summary: Okular not release memory (ram) taken by closed documents
Status: RESOLVED FIXED
Alias: None
Product: okular
Classification: Applications
Component: PDF backend (show other bugs)
Version: 1.4.1
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: Okular developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-05-29 16:40 UTC by CnZhx
Modified: 2018-05-30 16:04 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description CnZhx 2018-05-29 16:40:22 UTC
Hi there, I report this but I am not really sure about this problem. I used Okular a lot for paper reading. The settings are almost the same as default, especially the Performance is set to Normal.

I used to open a lot of papers at the same time and switching between them. Okular responses quickly. After a while, Okular takes around 5 to 6 GB of ram, which is not a problem for me as long as the memory is not exhausted. After I close some PDFs and open some others, the taken RAM keeps increasing but seems never being released after closure of some documents. That is fine, I think. However, when there is little memory left for my system to use, like only 0.5 GB left, and I need to open another programme, that causes problem and the system starts to use swap space. Okular still does not release the memory it takes. I think this situation need improvement so that Okular could somewhat release some memory space when some documents have been closed for a long time.

Thank you.
Comment 1 Albert Astals Cid 2018-05-30 08:57:02 UTC
Git commit 95bc29a76fc1f93eaabe5383d934644067dfc884 by Albert Astals Cid.
Committed on 30/05/2018 at 08:55.
Pushed by aacid into branch 'Applications/18.04'.

Force release of free memory

This should not be needed, but i can totally reproduce that without it
top is still reporting lots of memory used by Okular when it's really
not (heaptrack reports memory freed correctly)

M  +4    -0    OkularConfigureChecks.cmake
M  +3    -0    config-okular.h.cmake
M  +11   -0    core/document.cpp

https://commits.kde.org/okular/95bc29a76fc1f93eaabe5383d934644067dfc884
Comment 2 CnZhx 2018-05-30 10:18:10 UTC
Thanks @Albert for this amazingly fast fix.
Comment 3 Dileep Sankhla 2018-05-30 16:00:39 UTC
Git commit 30cf1951a676401591b50d29abedcec6e0de7001 by Dileep Sankhla, on behalf of Albert Astals Cid.
Committed on 30/05/2018 at 15:56.
Pushed by dileepsankhla into branch 'gsoc2018_typewriter'.

Force release of free memory

This should not be needed, but i can totally reproduce that without it
top is still reporting lots of memory used by Okular when it's really
not (heaptrack reports memory freed correctly)

M  +4    -0    OkularConfigureChecks.cmake
M  +3    -0    config-okular.h.cmake
M  +11   -0    core/document.cpp

https://commits.kde.org/okular/30cf1951a676401591b50d29abedcec6e0de7001
Comment 4 Luigi Toscano 2018-05-30 16:04:45 UTC
Dileep, please merge master into your branch, or rebase your changes on top of master, but try to not cherry-pick.