llmemory.h cleanup. pulled llpointer, refcounter, smartpointer, singleton and safe handle out into their own headers. llmemory.h drags all those headers in for legacy support until everything else is cleaned up. getCurrentRSS() moved into LLMemory. getWorkingSetSize() added to LLMemory.

This commit is contained in:
Shyotl
2011-07-29 20:40:08 -05:00
parent 1e92e734d8
commit a237cb9cad
14 changed files with 898 additions and 464 deletions

View File

@@ -3789,10 +3789,21 @@
<key>Value</key>
<integer>0</integer>
</map>
<key>DebugShowMemory</key>
<map>
<key>Comment</key>
<string>Show Total Allocated Memory</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>DebugShowRenderInfo</key>
<map>
<key>Comment</key>
<string>Show depth buffer contents</string>
<string>Show stats about current scene</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>

View File

@@ -2628,7 +2628,7 @@ void LLAppViewer::handleViewerCrash()
gDebugInfo["CurrentPath"] = gDirUtilp->getCurPath();
gDebugInfo["SessionLength"] = F32(LLFrameTimer::getElapsedSeconds());
gDebugInfo["StartupState"] = LLStartUp::getStartupStateString();
gDebugInfo["RAMInfo"]["Allocated"] = (LLSD::Integer) getCurrentRSS() >> 10;
gDebugInfo["RAMInfo"]["Allocated"] = (LLSD::Integer) LLMemory::getCurrentRSS() >> 10;
gDebugInfo["FirstLogin"] = (LLSD::Boolean) gAgent.isFirstLogin();
gDebugInfo["FirstRunThisInstall"] = gSavedSettings.getBOOL("FirstRunThisInstall");

View File

@@ -220,7 +220,7 @@ void display_stats()
F32 mem_log_freq = gSavedSettings.getF32("MemoryLogFrequency");
if (mem_log_freq > 0.f && gRecentMemoryTime.getElapsedTimeF32() >= mem_log_freq)
{
gMemoryAllocated = getCurrentRSS();
gMemoryAllocated = LLMemory::getCurrentRSS();
U32 memory = (U32)(gMemoryAllocated / (1024*1024));
llinfos << llformat("MEMORY: %d MB", memory) << llendl;
gRecentMemoryTime.reset();

View File

@@ -707,7 +707,7 @@ void send_stats()
agent["ping"] = gAvgSimPing;
agent["meters_traveled"] = gAgent.getDistanceTraveled();
agent["regions_visited"] = gAgent.getRegionsVisited();
agent["mem_use"] = getCurrentRSS() / 1024.0;
agent["mem_use"] = LLMemory::getCurrentRSS() / 1024.0;
LLSD &system = body["system"];

View File

@@ -333,6 +333,13 @@ public:
addText(xpos, ypos, llformat("Time: %d:%02d:%02d", hours,mins,secs)); ypos += y_inc;
}
#if LL_WINDOWS
if (gSavedSettings.getBOOL("DebugShowMemory"))
{
addText(xpos, ypos, llformat("Memory: %d (KB)", LLMemory::getWorkingSetSize() / 1024));
ypos += y_inc;
}
#endif
if (gDisplayCameraPos)
{
std::string camera_view_text;