Especially on large pdf files, okular tends to occupy insane amounts of memory. That’s because already rendered pages are kept in the cache for faster revisit and as you scroll quickly through a large pdf (let’s assume a couple hundred pages), okular can easily occopy Gigabytes of RAM for a few MB sized pdf file.
The problem is existing for quite a while and a couple of version now and there is even a bug report in the kde bug tracker. As a quick fix, I would simply suggest to lower okular’s MemoryLevel. Modern processors usually render regular pages (eBooks, datasheets, application notes etc.) almost instantly and as long as you don’t mess around with technical drawings or other render-intensive stuff inside the pdf, there is really no reason to use heap space that aggressively.
You can either use the GUI (Settings → Configure Okular… → Performance → Memory Usage) to the the Memory Usage to “Low”,
or change the MemoryLevel variable in .kde/share/config/okularpartrc
to “Low”. If the variable (or the Dlg Performance
-Section) doesn’t exist, simply create it.
[Dlg Performance] MemoryLevel=Low
your fix works well, thanks!