summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
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 6ebb0162a4..3699dbc3ec 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -5646,6 +5646,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 7e597fe5dc..e6942971f3 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -722,7 +722,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, "");
@@ -1122,63 +1122,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();
}
}