summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorOz Linden <oz@lindenlab.com>2011-10-11 10:58:02 -0400
committerOz Linden <oz@lindenlab.com>2011-10-11 10:58:02 -0400
commit852349218e5cfdd48a1a64c672e9663aab716031 (patch)
treefb7fd8f2947639a6a445aed0c72b1cc12ffb6296 /indra/newview
parentbaf802e25b1006783a69625e90022db087aabbfb (diff)
parent616a7b549d21624e6667218efe29c1e552f9b375 (diff)
merge changes for vwr-26864
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/app_settings/settings.xml11
-rw-r--r--indra/newview/llappviewer.cpp58
-rw-r--r--indra/newview/llviewerdisplay.cpp2
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();
}
}