Bug 562519 cache result from PR_GetPhysicalMemorySize
r=biesi
This commit is contained in:
Родитель
e5423f7d9a
Коммит
5325dfd5f8
|
@ -220,7 +220,7 @@ nsProfileCollector::LogMemory(nsIMetricsEventItem *profile)
|
|||
nsMetricsUtils::NewPropertyBag(getter_AddRefs(properties));
|
||||
NS_ENSURE_STATE(properties);
|
||||
|
||||
PRUint64 size = PR_GetPhysicalMemorySize();
|
||||
static PRUint64 size = PR_GetPhysicalMemorySize();
|
||||
if (size == 0) {
|
||||
MS_LOG(("Failed to get physical memory size"));
|
||||
return NS_ERROR_FAILURE;
|
||||
|
|
|
@ -579,7 +579,7 @@ nsCacheProfilePrefObserver::MemoryCacheCapacity()
|
|||
return capacity;
|
||||
}
|
||||
|
||||
PRUint64 bytes = PR_GetPhysicalMemorySize();
|
||||
static PRUint64 bytes = PR_GetPhysicalMemorySize();
|
||||
CACHE_LOG_DEBUG(("Physical Memory size is %llu\n", bytes));
|
||||
|
||||
// If getting the physical memory failed, arbitrarily assume
|
||||
|
|
|
@ -687,7 +687,9 @@ nsNavHistory::InitDB()
|
|||
cachePercentage = 50;
|
||||
if (cachePercentage < 0)
|
||||
cachePercentage = 0;
|
||||
PRInt64 cacheSize = PR_GetPhysicalMemorySize() * cachePercentage / 100;
|
||||
|
||||
static PRInt64 physMem = PR_GetPhysicalMemorySize();
|
||||
PRInt64 cacheSize = physMem * cachePercentage / 100;
|
||||
|
||||
// Compute number of cached pages, this will be our cache size.
|
||||
PRInt64 cachePages = cacheSize / pageSize;
|
||||
|
|
Загрузка…
Ссылка в новой задаче