Commit 8d501fc4 authored by Kevin Slagle's avatar Kevin Slagle Committed by Albert Astals Cid
Browse files

getFreeMemory is called every two seconds when checking to see if the system...

getFreeMemory is called every two seconds when checking to see if the system is low on memory. Before this commit, half of these checks are useless (when okular is idle) since the cache is used when the cache is <=2 seconds old. This means that after they system is out of memory, up to 4 seconds (instead of 2) could go by before okular starts to free memory.
parent 4019ec56
......@@ -434,7 +434,7 @@ qulonglong DocumentPrivate::getFreeMemory( qulonglong *freeSwap )
static qulonglong cachedValue = 0;
static qulonglong cachedFreeSwap = 0;
if ( qAbs( lastUpdate.secsTo( QTime::currentTime() ) ) <= 2 )
if ( qAbs( lastUpdate.msecsTo( QTime::currentTime() ) ) <= 1900 )
{
if (freeSwap)
*freeSwap = cachedFreeSwap;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment