summaryrefslogtreecommitdiff
path: root/indra/newview/llappviewer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llappviewer.cpp')
-rw-r--r--indra/newview/llappviewer.cpp58
1 files changed, 10 insertions, 48 deletions
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index 11e2e1e607..a4640f5504 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -724,7 +724,7 @@ bool LLAppViewer::init()
//set the max heap size.
initMaxHeapSize() ;
- LLPrivateMemoryPoolManager::initClass((BOOL)gSavedSettings.getBOOL("MemoryPrivatePoolEnabled")) ;
+ LLPrivateMemoryPoolManager::initClass((BOOL)gSavedSettings.getBOOL("MemoryPrivatePoolEnabled"), (U32)gSavedSettings.getU32("MemoryPrivatePoolSize")) ;
// write Google Breakpad minidump files to our log directory
std::string logdir = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "");
@@ -1124,63 +1124,25 @@ void LLAppViewer::checkMemory()
{
const static F32 MEMORY_CHECK_INTERVAL = 1.0f ; //second
//const static F32 MAX_QUIT_WAIT_TIME = 30.0f ; //seconds
- const static U32 MAX_SIZE_CHECKED_MEMORY_BLOCK = 64 * 1024 * 1024 ; //64 MB
- //static F32 force_quit_timer = MAX_QUIT_WAIT_TIME + MEMORY_CHECK_INTERVAL ;
- static void* last_reserved_address = NULL ;
+ //static F32 force_quit_timer = MAX_QUIT_WAIT_TIME + MEMORY_CHECK_INTERVAL ;
- if(MEMORY_CHECK_INTERVAL > mMemCheckTimer.getElapsedTimeF32())
+ if(!gGLManager.mDebugGPU)
{
return ;
}
- mMemCheckTimer.reset() ;
-
- if(gGLManager.mDebugGPU)
- {
- //update the availability of memory
- LLMemory::updateMemoryInfo() ;
- }
- //check the virtual address space fragmentation
- if(!last_reserved_address)
- {
- last_reserved_address = LLMemory::tryToAlloc(last_reserved_address, MAX_SIZE_CHECKED_MEMORY_BLOCK) ;
- }
- else
+ if(MEMORY_CHECK_INTERVAL > mMemCheckTimer.getElapsedTimeF32())
{
- last_reserved_address = LLMemory::tryToAlloc(last_reserved_address, MAX_SIZE_CHECKED_MEMORY_BLOCK) ;
- if(!last_reserved_address) //failed, try once more
- {
- last_reserved_address = LLMemory::tryToAlloc(last_reserved_address, MAX_SIZE_CHECKED_MEMORY_BLOCK) ;
- }
+ return ;
}
+ mMemCheckTimer.reset() ;
- S32 is_low = !last_reserved_address || LLMemory::isMemoryPoolLow() ;
-
- //if(is_low < 0) //to force quit
- //{
- // if(force_quit_timer > MAX_QUIT_WAIT_TIME) //just hit the limit for the first time
- // {
- // //send out the notification to tell the viewer is about to quit in 30 seconds.
- // LLNotification::Params params("ForceQuitDueToLowMemory");
- // LLNotifications::instance().add(params);
+ //update the availability of memory
+ LLMemory::updateMemoryInfo() ;
- // force_quit_timer = MAX_QUIT_WAIT_TIME - MEMORY_CHECK_INTERVAL ;
- // }
- // else
- // {
- // force_quit_timer -= MEMORY_CHECK_INTERVAL ;
- // if(force_quit_timer < 0.f)
- // {
- // forceQuit() ; //quit
- // }
- // }
- //}
- //else
- //{
- // force_quit_timer = MAX_QUIT_WAIT_TIME + MEMORY_CHECK_INTERVAL ;
- //}
+ bool is_low = LLMemory::isMemoryPoolLow() ;
- LLPipeline::throttleNewMemoryAllocation(!is_low ? FALSE : TRUE) ;
+ LLPipeline::throttleNewMemoryAllocation(is_low) ;
if(is_low)
{