From 6661628d5c68855ddffc54a3f2578f93ada84de1 Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Wed, 12 Feb 2014 20:50:32 -0700 Subject: add two debug settings: "SceneLoadLowMemoryBound" and "SceneLoadHighMemoryBound" --- indra/newview/app_settings/settings.xml | 22 ++++++++++++++++++++++ indra/newview/llvocache.cpp | 13 +++++++------ 2 files changed, 29 insertions(+), 6 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 325cdb3a03..83fc639050 100755 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -10231,6 +10231,28 @@ Value 100.0 + SceneLoadHighMemoryBound + + Comment + in MB, when total memory usage above this threshold, minimum invisible objects are kept in memory + Persist + 1 + Type + U32 + Value + 1024 + + SceneLoadLowMemoryBound + + Comment + in MB, when total memory usage above this threshold, start to reduce invisible objects kept in memory + Persist + 1 + Type + U32 + Value + 750 + SceneLoadMinRadius Comment diff --git a/indra/newview/llvocache.cpp b/indra/newview/llvocache.cpp index 0f29e9cfa2..fd1d57a9d0 100755 --- a/indra/newview/llvocache.cpp +++ b/indra/newview/llvocache.cpp @@ -414,17 +414,18 @@ void LLVOCacheEntry::updateDebugSettings() sRearFarRadius = llmin(sRearFarRadius, gAgentCamera.mDrawDistance); //can not be more than the draw distance. //make the above parameters adaptive to memory usage - //starts to put restrictions from 750MB, apply tightest restrictions when hits 1GB - const U32 low_bound = 750 * 1024; //KB - const U32 high_bound = 1024 * 1024; //KB - + //starts to put restrictions from low_mem_bound_MB, apply tightest restrictions when hits high_mem_bound_MB + static LLCachedControl low_mem_bound_MB(gSavedSettings,"SceneLoadLowMemoryBound"); + static LLCachedControl high_mem_bound_MB(gSavedSettings,"SceneLoadHighMemoryBound"); + LLMemory::updateMemoryInfo() ; U32 allocated_mem = LLMemory::getAllocatedMemKB().value(); - if(allocated_mem < low_bound) + allocated_mem /= 1024; //convert to MB. + if(allocated_mem < low_mem_bound_MB) { return; } - F32 adjust_factor = llmax(0.f, (F32)(high_bound - allocated_mem) / (high_bound - low_bound)); + F32 adjust_factor = llmax(0.f, (F32)(high_mem_bound_MB - allocated_mem) / (high_mem_bound_MB - low_mem_bound_MB)); sRearFarRadius = llmin(adjust_factor * sRearFarRadius, 96.f); //[0.f, 96.f] sMinFrameRange = (U32)llclamp(adjust_factor * sMinFrameRange, 10.f, 64.f); //[10, 64] -- cgit v1.2.3