Memory consumption in statistics floater

This commit is contained in:
Siana Gearz
2012-03-01 13:49:47 +01:00
parent ab26e1008f
commit 251b0fa5c0
5 changed files with 84 additions and 6 deletions

View File

@@ -61,6 +61,7 @@
#include "llfeaturemanager.h"
#include "llviewernetwork.h"
#include "llmeshrepository.h" //for LLMeshRepository::sBytesReceived
#include "sgmemstat.h"
#if LL_LCD_COMPILE
#include "lllcd.h"
#endif
@@ -689,6 +690,17 @@ void update_statistics(U32 frame_count)
}
}
{
static const F32 mem_stats_freq = 10.f;
static LLFrameTimer mem_stats_timer;
if (mem_stats_timer.getElapsedTimeF32() >= mem_stats_freq)
{
LLViewerStats::getInstance()->mMallocStat.addValue(SGMemStat::getMalloc()/1024.f/1024.f);
mem_stats_timer.reset();
}
}
#if LL_LCD_COMPILE
bool LCDenabled = gLcdScreen->Enabled();
LLViewerStats::getInstance()->setStat(LLViewerStats::ST_LOGITECH_LCD, LCDenabled);