summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
Diffstat (limited to 'indra')
-rw-r--r--indra/llcommon/llmemory.cpp54
-rw-r--r--indra/llcommon/llmemory.h4
-rw-r--r--indra/llrender/llgl.cpp6
-rw-r--r--indra/llrender/llgl.h1
-rw-r--r--indra/newview/app_settings/settings.xml2
-rw-r--r--indra/newview/llappviewer.cpp33
-rw-r--r--indra/newview/llappviewer.h3
-rw-r--r--indra/newview/lldynamictexture.cpp2
-rw-r--r--indra/newview/llviewerdisplay.cpp5
-rw-r--r--indra/newview/llviewertexture.cpp7
-rw-r--r--indra/newview/llviewerwindow.cpp4
-rw-r--r--indra/newview/pipeline.cpp19
-rw-r--r--indra/newview/pipeline.h5
13 files changed, 6 insertions, 139 deletions
diff --git a/indra/llcommon/llmemory.cpp b/indra/llcommon/llmemory.cpp
index 7cf4bc0706..ea84e4c1ea 100644
--- a/indra/llcommon/llmemory.cpp
+++ b/indra/llcommon/llmemory.cpp
@@ -55,7 +55,6 @@ static LLTrace::SampleStatHandle<F64Megabytes> sVirtualMem("virtual_mem", "virtu
U32Kilobytes LLMemory::sAllocatedMemInKB(0);
U32Kilobytes LLMemory::sAllocatedPageSizeInKB(0);
U32Kilobytes LLMemory::sMaxHeapSizeInKB(U32_MAX);
-BOOL LLMemory::sEnableMemoryFailurePrevention = FALSE;
void ll_assert_aligned_func(uintptr_t ptr,U32 alignment)
{
@@ -75,10 +74,9 @@ void ll_assert_aligned_func(uintptr_t ptr,U32 alignment)
}
//static
-void LLMemory::initMaxHeapSizeGB(F32Gigabytes max_heap_size, BOOL prevent_heap_failure)
+void LLMemory::initMaxHeapSizeGB(F32Gigabytes max_heap_size)
{
sMaxHeapSizeInKB = U32Kilobytes::convert(max_heap_size);
- sEnableMemoryFailurePrevention = prevent_heap_failure ;
}
//static
@@ -158,56 +156,6 @@ void LLMemory::logMemoryInfo(BOOL update)
LL_INFOS() << "Current max usable memory(KB): " << sMaxPhysicalMemInKB << LL_ENDL ;
}
-//return 0: everything is normal;
-//return 1: the memory pool is low, but not in danger;
-//return -1: the memory pool is in danger, is about to crash.
-//static
-bool LLMemory::isMemoryPoolLow()
-{
- static const U32Megabytes LOW_MEMORY_POOL_THRESHOLD(64);
- const static U32Megabytes MAX_SIZE_CHECKED_MEMORY_BLOCK(64);
- static void* last_reserved_address = NULL ;
-
- if(!sEnableMemoryFailurePrevention)
- {
- return false ; //no memory failure prevention.
- }
-
- if(sAvailPhysicalMemInKB < (LOW_MEMORY_POOL_THRESHOLD / 4)) //out of physical memory
- {
- return true ;
- }
-
- if(sAllocatedPageSizeInKB + (LOW_MEMORY_POOL_THRESHOLD / 4) > sMaxHeapSizeInKB) //out of virtual address space.
- {
- return true ;
- }
-
- bool is_low = (S32)(sAvailPhysicalMemInKB < LOW_MEMORY_POOL_THRESHOLD
- || sAllocatedPageSizeInKB + LOW_MEMORY_POOL_THRESHOLD > sMaxHeapSizeInKB) ;
-
- //check the virtual address space fragmentation
- if(!is_low)
- {
- if(!last_reserved_address)
- {
- last_reserved_address = LLMemory::tryToAlloc(last_reserved_address, MAX_SIZE_CHECKED_MEMORY_BLOCK.value()) ;
- }
- else
- {
- last_reserved_address = LLMemory::tryToAlloc(last_reserved_address, MAX_SIZE_CHECKED_MEMORY_BLOCK.value()) ;
- if(!last_reserved_address) //failed, try once more
- {
- last_reserved_address = LLMemory::tryToAlloc(last_reserved_address, MAX_SIZE_CHECKED_MEMORY_BLOCK.value()) ;
- }
- }
-
- is_low = !last_reserved_address ; //allocation failed
- }
-
- return is_low ;
-}
-
//static
U32Kilobytes LLMemory::getAvailableMemKB()
{
diff --git a/indra/llcommon/llmemory.h b/indra/llcommon/llmemory.h
index f04ae5f5cb..24f86cc11e 100644
--- a/indra/llcommon/llmemory.h
+++ b/indra/llcommon/llmemory.h
@@ -344,10 +344,9 @@ public:
// Return value is zero if not known.
static U64 getCurrentRSS();
static void* tryToAlloc(void* address, U32 size);
- static void initMaxHeapSizeGB(F32Gigabytes max_heap_size, BOOL prevent_heap_failure);
+ static void initMaxHeapSizeGB(F32Gigabytes max_heap_size);
static void updateMemoryInfo() ;
static void logMemoryInfo(BOOL update = FALSE);
- static bool isMemoryPoolLow();
static U32Kilobytes getAvailableMemKB() ;
static U32Kilobytes getMaxMemKB() ;
@@ -359,7 +358,6 @@ private:
static U32Kilobytes sAllocatedPageSizeInKB ;
static U32Kilobytes sMaxHeapSizeInKB;
- static BOOL sEnableMemoryFailurePrevention;
};
// LLRefCount moved to llrefcount.h
diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp
index 36177e00e8..fa4d0977b2 100644
--- a/indra/llrender/llgl.cpp
+++ b/indra/llrender/llgl.cpp
@@ -852,10 +852,6 @@ bool LLGLManager::initGL()
stop_glerror();
- setToDebugGPU();
-
- stop_glerror();
-
initGLStates();
stop_glerror();
@@ -863,8 +859,6 @@ bool LLGLManager::initGL()
return true;
}
-//void LLGLManager::setToDebugGPU()
-
void LLGLManager::getGLInfo(LLSD& info)
{
if (gHeadlessClient)
diff --git a/indra/llrender/llgl.h b/indra/llrender/llgl.h
index 95cc1899ee..3d597a23fe 100644
--- a/indra/llrender/llgl.h
+++ b/indra/llrender/llgl.h
@@ -173,7 +173,6 @@ private:
void initExtensions();
void initGLStates();
void initGLImages();
- void setToDebugGPU();
};
extern LLGLManager gGLManager;
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 52dc4744f2..0b9cc78132 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -6564,7 +6564,7 @@
<key>Value</key>
<integer>1</integer>
</map>
- <key>MemoryFailurePreventionEnabled</key>
+ <key>MemoryFailurePreventionEnabled</key> <!-- deprecated, only used for obsolete-in-2020 Intel 965 Express GPU -->
<map>
<key>Comment</key>
<string>If set, the viewer will quit to avoid crash when memory failure happens</string>
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index 9452028174..4c4848390f 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -1280,36 +1280,8 @@ void LLAppViewer::initMaxHeapSize()
//F32 max_heap_size_gb = llmin(1.6f, (F32)gSavedSettings.getF32("MaxHeapSize")) ;
F32Gigabytes max_heap_size_gb = (F32Gigabytes)gSavedSettings.getF32("MaxHeapSize") ;
- BOOL enable_mem_failure_prevention = (BOOL)gSavedSettings.getBOOL("MemoryFailurePreventionEnabled") ;
- LLMemory::initMaxHeapSizeGB(max_heap_size_gb, enable_mem_failure_prevention) ;
-}
-
-void LLAppViewer::checkMemory()
-{
- const static F32 MEMORY_CHECK_INTERVAL = 1.0f ; //second
- //const static F32 MAX_QUIT_WAIT_TIME = 30.0f ; //seconds
- //static F32 force_quit_timer = MAX_QUIT_WAIT_TIME + MEMORY_CHECK_INTERVAL ;
-
- return ;
-
- if(MEMORY_CHECK_INTERVAL > mMemCheckTimer.getElapsedTimeF32())
- {
- return ;
- }
- mMemCheckTimer.reset() ;
-
- //update the availability of memory
- LLMemory::updateMemoryInfo() ;
-
- bool is_low = LLMemory::isMemoryPoolLow() ;
-
- LLPipeline::throttleNewMemoryAllocation(is_low) ;
-
- if(is_low)
- {
- LLMemory::logMemoryInfo() ;
- }
+ LLMemory::initMaxHeapSizeGB(max_heap_size_gb);
}
static LLTrace::BlockTimerStatHandle FTM_MESSAGES("System Messages");
@@ -1388,9 +1360,6 @@ bool LLAppViewer::doFrame()
//clear call stack records
LL_CLEAR_CALLSTACKS();
- //check memory availability information
- checkMemory() ;
-
{
pingMainloopTimeout("Main:MiscNativeWindowEvents");
diff --git a/indra/newview/llappviewer.h b/indra/newview/llappviewer.h
index 8f0f54de3b..f3c5f5b500 100644
--- a/indra/newview/llappviewer.h
+++ b/indra/newview/llappviewer.h
@@ -230,7 +230,6 @@ private:
bool initConfiguration(); // Initialize settings from the command line/config file.
void initStrings(); // Initialize LLTrans machinery
bool initCache(); // Initialize local client cache.
- void checkMemory() ;
// We have switched locations of both Mac and Windows cache, make sure
// files migrate and old cache is cleared out.
@@ -306,8 +305,6 @@ private:
LLAllocator mAlloc;
- LLFrameTimer mMemCheckTimer;
-
// llcorehttp library init/shutdown helper
LLAppCoreHttp mAppCoreHttp;
diff --git a/indra/newview/lldynamictexture.cpp b/indra/newview/lldynamictexture.cpp
index 1edf8fd47c..8b8273d183 100644
--- a/indra/newview/lldynamictexture.cpp
+++ b/indra/newview/lldynamictexture.cpp
@@ -204,7 +204,7 @@ void LLViewerDynamicTexture::postRender(BOOL success)
BOOL LLViewerDynamicTexture::updateAllInstances()
{
sNumRenders = 0;
- if (gGLManager.mIsDisabled || LLPipeline::sMemAllocationThrottled)
+ if (gGLManager.mIsDisabled)
{
return TRUE;
}
diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp
index caf79edfe4..0c112047de 100644
--- a/indra/newview/llviewerdisplay.cpp
+++ b/indra/newview/llviewerdisplay.cpp
@@ -745,10 +745,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
glViewport(0,0,512,512);
LLVOAvatar::updateFreezeCounter() ;
- if(!LLPipeline::sMemAllocationThrottled)
- {
- LLVOAvatar::updateImpostors();
- }
+ LLVOAvatar::updateImpostors();
set_current_projection(proj);
set_current_modelview(mod);
diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp
index a2cec9a613..6a3cdafecb 100644
--- a/indra/newview/llviewertexture.cpp
+++ b/indra/newview/llviewertexture.cpp
@@ -3289,13 +3289,6 @@ void LLViewerLODTexture::processTextureStats()
{
mDesiredDiscardLevel = llmin(mDesiredDiscardLevel, (S8)mDesiredSavedRawDiscardLevel);
}
- else if(LLPipeline::sMemAllocationThrottled)//release memory of large textures by decrease their resolutions.
- {
- if(scaleDown())
- {
- mDesiredDiscardLevel = mCachedRawDiscardLevel;
- }
- }
}
bool LLViewerLODTexture::scaleDown()
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index da0f98851d..053e18d627 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -4789,10 +4789,6 @@ BOOL LLViewerWindow::rawSnapshot(LLImageRaw *raw, S32 image_width, S32 image_hei
return FALSE;
}
//check if there is enough memory for the snapshot image
- if(LLPipeline::sMemAllocationThrottled)
- {
- return FALSE ; //snapshot taking is disabled due to memory restriction.
- }
if(image_width * image_height > (1 << 22)) //if snapshot image is larger than 2K by 2K
{
if(!LLMemory::tryToAlloc(NULL, image_width * image_height * 3))
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index 604c5f770d..a898c2668b 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -347,7 +347,6 @@ bool LLPipeline::sRenderFrameTest = false;
bool LLPipeline::sRenderAttachedLights = true;
bool LLPipeline::sRenderAttachedParticles = true;
bool LLPipeline::sRenderDeferred = false;
-bool LLPipeline::sMemAllocationThrottled = false;
S32 LLPipeline::sVisibleLightCount = 0;
F32 LLPipeline::sMinRenderSize = 0.f;
bool LLPipeline::sRenderingHUDs;
@@ -717,24 +716,6 @@ void LLPipeline::destroyGL()
static LLTrace::BlockTimerStatHandle FTM_RESIZE_SCREEN_TEXTURE("Resize Screen Texture");
-//static
-void LLPipeline::throttleNewMemoryAllocation(bool disable)
-{
- if(sMemAllocationThrottled != disable)
- {
- sMemAllocationThrottled = disable ;
-
- if(sMemAllocationThrottled)
- {
- //send out notification
- LLNotification::Params params("LowMemory");
- LLNotifications::instance().add(params);
-
- //release some memory.
- }
- }
-}
-
void LLPipeline::requestResizeScreenTexture()
{
gResizeScreenTexture = TRUE;
diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h
index 600bdd9d06..d93d6cb50c 100644
--- a/indra/newview/pipeline.h
+++ b/indra/newview/pipeline.h
@@ -413,10 +413,6 @@ public:
static void updateRenderDeferred();
static void refreshCachedSettings();
- static void throttleNewMemoryAllocation(bool disable);
-
-
-
void addDebugBlip(const LLVector3& position, const LLColor4& color);
void hidePermanentObjects( std::vector<U32>& restoreList );
@@ -598,7 +594,6 @@ public:
static bool sRenderAttachedLights;
static bool sRenderAttachedParticles;
static bool sRenderDeferred;
- static bool sMemAllocationThrottled;
static S32 sVisibleLightCount;
static F32 sMinRenderSize;
static bool sRenderingHUDs;