diff options
author | Oz Linden <oz@lindenlab.com> | 2011-10-05 09:03:24 -0400 |
---|---|---|
committer | Oz Linden <oz@lindenlab.com> | 2011-10-05 09:03:24 -0400 |
commit | 194bedbb96a6dcfe90d5b731aeca8658c83f2306 (patch) | |
tree | e17372f3b592f8932dbe171c41393e56807f22ce /indra/newview | |
parent | d0e36ade5bb16e9e5a6aca9ee4f02fbe995cdfd8 (diff) | |
parent | 616a7b549d21624e6667218efe29c1e552f9b375 (diff) |
merge changes for vwr-26864
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/app_settings/settings.xml | 11 | ||||
-rw-r--r-- | indra/newview/llappviewer.cpp | 58 | ||||
-rw-r--r-- | indra/newview/llviewerdisplay.cpp | 2 |
3 files changed, 22 insertions, 49 deletions
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index be4ec93946..15f1bbd1b1 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -5657,6 +5657,17 @@ <key>Value</key> <integer>1</integer> </map> + <key>MemoryPrivatePoolSize</key> + <map> + <key>Comment</key> + <string>Size of the private memory pool in MB (min. value is 256)</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>U32</string> + <key>Value</key> + <integer>512</integer> + </map> <key>MemProfiling</key> <map> <key>Comment</key> 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) { diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp index 6142ee0dd6..19326c4e30 100644 --- a/indra/newview/llviewerdisplay.cpp +++ b/indra/newview/llviewerdisplay.cpp @@ -202,7 +202,7 @@ void display_stats() gMemoryAllocated = LLMemory::getCurrentRSS(); U32 memory = (U32)(gMemoryAllocated / (1024*1024)); llinfos << llformat("MEMORY: %d MB", memory) << llendl; - LLMemory::logMemoryInfo() ; + LLMemory::logMemoryInfo(TRUE) ; gRecentMemoryTime.reset(); } } |