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.
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
Thanks @Albert for this amazingly fast fix.
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
Dileep, please merge master into your branch, or rebase your changes on top of master, but try to not cherry-pick.