[Okular-devel] [Bug 291129] Okular easily occupies huge memory after scrolling in pdf files

Albert Astals Cid tsdgeos at terra.es
Tue Jun 19 22:38:28 UTC 2012


https://bugs.kde.org/show_bug.cgi?id=291129

Albert Astals Cid <tsdgeos at terra.es> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Latest Commit|http://commits.kde.org/okul |http://commits.kde.org/okul
                   |ar/444e6b7b19bee5285f39a440 |ar/5fb937a46aaf4e531ada8166
                   |07cf00f6e0b235d2            |92b1e47fc95b20b0

--- Comment #16 from Albert Astals Cid <tsdgeos at terra.es> ---
Git commit 5fb937a46aaf4e531ada816692b1e47fc95b20b0 by Albert Astals Cid.
Committed on 20/06/2012 at 00:33.
Pushed by aacid into branch 'KDE/4.8'.

Fix underflow in getFreeMemory()

It actually serves three purposes:
a) Make sure all the values are there (this should be always true, but doesn't
hurt making sure) because if SwapFree was there but SwapTotal was not, it'd be
a mess
b) add up things in order so we don't underflow, currently the code did process
stuff as it came in the file, and it happens that SwapTotal appears before
SwapFree in /proc/meminfo so it actually did  "MemFree:" + "Buffers:" +
"Cached:" - "SwapTotal:" + "SwapFree:", which can underflow if "MemFree:" +
"Buffers:" + "Cached:" < "SwapTotal:"
c) Do not underflow at all, so if  "MemFree:" + "Buffers:" + "Cached:" + 
"SwapFree:" < "SwapTotal:" we return 0 correctly not a zillion of free memory

Aurélien you might want to update gwenviews copy of this code (there's a few
other bugfixes we did a while ago you didn't update either)

CCMAIL: agateau at kde.org
(cherry picked from commit 444e6b7b19bee5285f39a44007cf00f6e0b235d2)

M  +22   -7    core/document.cpp

http://commits.kde.org/okular/5fb937a46aaf4e531ada816692b1e47fc95b20b0

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the Okular-devel mailing list