diff options
-rwxr-xr-x | indra/newview/app_settings/settings.xml | 22 | ||||
-rwxr-xr-x | indra/newview/llvocache.cpp | 13 |
2 files changed, 29 insertions, 6 deletions
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 @@ <key>Value</key> <real>100.0</real> </map> + <key>SceneLoadHighMemoryBound</key> + <map> + <key>Comment</key> + <string>in MB, when total memory usage above this threshold, minimum invisible objects are kept in memory </string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>U32</string> + <key>Value</key> + <real>1024</real> + </map> + <key>SceneLoadLowMemoryBound</key> + <map> + <key>Comment</key> + <string>in MB, when total memory usage above this threshold, start to reduce invisible objects kept in memory </string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>U32</string> + <key>Value</key> + <real>750</real> + </map> <key>SceneLoadMinRadius</key> <map> <key>Comment</key> 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<U32> low_mem_bound_MB(gSavedSettings,"SceneLoadLowMemoryBound"); + static LLCachedControl<U32> 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] |