[Okular-devel] [Bug 291129] Okular easily occupies huge memory after scrolling in pdf files
Benni Hill
benni at mytum.de
Tue Jun 19 20:21:21 UTC 2012
https://bugs.kde.org/show_bug.cgi?id=291129
Benni Hill <benni at mytum.de> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |benni at mytum.de
--- Comment #14 from Benni Hill <benni at mytum.de> ---
Hi,
I think I found a bug in DocumentPrivate::getFreeMemory().
I was programming on Gwenview which has a copied version of this function in
its code.
When writing the output of getFreeMemory() to stdout via qDebug() I sometimes
get values like 18446744073694777344 which suggest that there is an integer
underflow. Here is an excerpt from cat /proc/meminfo shortly after that
happened:
MemTotal: 2824516 kB
MemFree: 277580 kB
Buffers: 10292 kB
Cached: 169928 kB
SwapCached: 32984 kB
Active: 1733572 kB
Inactive: 546212 kB
Active(anon): 1663072 kB
Inactive(anon): 468348 kB
Active(file): 70500 kB
Inactive(file): 77864 kB
Unevictable: 11316 kB
Mlocked: 11316 kB
SwapTotal: 7814140 kB
SwapFree: 7334064 kB
When I understand the function properly it is calculation the free memory as:
MemFree + Buffers + Cached + SwapFree - SwapTotal
which in this case would result in a negative value of -22 276 kB which can't
be returned as qulonglong.
--
You are receiving this mail because:
You are the assignee for the bug.
More information about the Okular-devel
mailing list