diff --git a/indra/llcommon/llinstancetracker.h b/indra/llcommon/llinstancetracker.h
index 1385475444b6b994b2f110c3eddfaaacde58f61e..3fdb84cfd7cc4967c2c17b04fda22938400ff8c8 100755
--- a/indra/llcommon/llinstancetracker.h
+++ b/indra/llcommon/llinstancetracker.h
@@ -215,7 +215,7 @@ class LLInstanceTracker : public LLInstanceTrackerBase
 	{ 
 		mInstanceKey = key; 
 		InstanceMap& map = getMap_();
-		InstanceMap::iterator insertion_point_it = map.lower_bound(key);
+		typename InstanceMap::iterator insertion_point_it = map.lower_bound(key);
 		if (ALLOW_KEY_COLLISIONS == InstanceTrackerDisallowKeyCollisions
 			&& insertion_point_it != map.end() 
 			&& insertion_point_it->first == key)
diff --git a/indra/llcommon/lltraceaccumulators.h b/indra/llcommon/lltraceaccumulators.h
index c30cc9a107486f047802a4c4285eaef2a7763773..2971907849b44aef1d2c3775be0b77bd8090671e 100644
--- a/indra/llcommon/lltraceaccumulators.h
+++ b/indra/llcommon/lltraceaccumulators.h
@@ -226,6 +226,7 @@ namespace LLTrace
 	{
 	public:
 		typedef F64 value_t;
+		static F64 getDefaultValue() { return NaN; }
 
 		EventAccumulator()
 		:	mSum(0),
@@ -293,6 +294,7 @@ namespace LLTrace
 	{
 	public:
 		typedef F64 value_t;
+		static F64 getDefaultValue() { return NaN; }
 
 		SampleAccumulator()
 		:	mSum(0),
@@ -385,6 +387,7 @@ namespace LLTrace
 	{
 	public:
 		typedef F64 value_t;
+		static F64 getDefaultValue() { return 0; }
 
 		CountAccumulator()
 		:	mSum(0),
@@ -415,6 +418,8 @@ namespace LLTrace
 
 		S32 getSampleCount() const { return mNumSamples; }
 
+		bool hasValue() const			 { return true; }
+
 	private:
 		F64	mSum;
 
@@ -425,6 +430,8 @@ namespace LLTrace
 	{
 	public:
 		typedef F64Seconds value_t;
+		static F64Seconds getDefaultValue() { return F64Seconds(0); }
+
 		typedef TimeBlockAccumulator self_t;
 
 		// fake classes that allows us to view different facets of underlying statistic
@@ -453,6 +460,7 @@ namespace LLTrace
 		void addSamples(const self_t& other, EBufferAppendType append_type);
 		void reset(const self_t* other);
 		void sync(F64SecondsImplicit) {}
+		bool hasValue() const { return true; }
 
 		//
 		// members
@@ -493,17 +501,22 @@ namespace LLTrace
 
 	struct MemAccumulator
 	{
+		typedef F64Bytes value_t;
+		static F64Bytes getDefaultValue() { return F64Bytes(0); }
+
 		typedef MemAccumulator self_t;
 
 		// fake classes that allows us to view different facets of underlying statistic
 		struct AllocationFacet 
 		{
 			typedef F64Bytes value_t;
+			static F64Bytes getDefaultValue() { return F64Bytes(0); }
 		};
 
 		struct DeallocationFacet 
 		{
 			typedef F64Bytes value_t;
+			static F64Bytes getDefaultValue() { return F64Bytes(0); }
 		};
 
 		void addSamples(const MemAccumulator& other, EBufferAppendType append_type)
@@ -536,6 +549,8 @@ namespace LLTrace
 			mSize.sync(time_stamp);
 		}
 
+		bool hasValue() const			 { return mSize.hasValue(); }
+
 		SampleAccumulator	mSize;
 		EventAccumulator	mAllocations;
 		CountAccumulator	mDeallocations;
diff --git a/indra/llcommon/lltracerecording.cpp b/indra/llcommon/lltracerecording.cpp
index 2b2b55f614b86d6d12edec2d8be550425db0dce2..6ad6bbe35670df1fb03ddc3dfffd028370a54054 100644
--- a/indra/llcommon/lltracerecording.cpp
+++ b/indra/llcommon/lltracerecording.cpp
@@ -137,6 +137,12 @@ void Recording::appendRecording( Recording& other )
 	mElapsedSeconds += other.mElapsedSeconds;
 }
 
+bool Recording::hasValue(const StatType<TimeBlockAccumulator>& stat)
+{
+	llassert(!isStarted());
+	return mBuffers->mStackTimers[stat.getIndex()].hasValue();
+}
+
 F64Seconds Recording::getSum(const StatType<TimeBlockAccumulator>& stat)
 {
 	llassert(!isStarted());
@@ -219,6 +225,12 @@ F64Kilobytes Recording::getLastValue(const StatType<MemAccumulator>& stat)
 	return F64Bytes(mBuffers->mMemStats[stat.getIndex()].mSize.getLastValue());
 }
 
+bool Recording::hasValue(const StatType<MemAccumulator::AllocationFacet>& stat)
+{
+	llassert(!isStarted());
+	return mBuffers->mMemStats[stat.getIndex()].mAllocations.hasValue();
+}
+
 F64Kilobytes Recording::getSum(const StatType<MemAccumulator::AllocationFacet>& stat)
 {
 	llassert(!isStarted());
@@ -237,6 +249,13 @@ S32 Recording::getSampleCount(const StatType<MemAccumulator::AllocationFacet>& s
 	return mBuffers->mMemStats[stat.getIndex()].mAllocations.getSampleCount();
 }
 
+bool Recording::hasValue(const StatType<MemAccumulator::DeallocationFacet>& stat)
+{
+	llassert(!isStarted());
+	return mBuffers->mMemStats[stat.getIndex()].mDeallocations.hasValue();
+}
+
+
 F64Kilobytes Recording::getSum(const StatType<MemAccumulator::DeallocationFacet>& stat)
 {
 	llassert(!isStarted());
@@ -255,13 +274,19 @@ S32 Recording::getSampleCount(const StatType<MemAccumulator::DeallocationFacet>&
 	return mBuffers->mMemStats[stat.getIndex()].mDeallocations.getSampleCount();
 }
 
-F64 Recording::getSum( const StatType<CountAccumulator>& stat )
+bool Recording::hasValue(const StatType<CountAccumulator>& stat)
+{
+	llassert(!isStarted());
+	return mBuffers->mCounts[stat.getIndex()].hasValue();
+}
+
+F64 Recording::getSum(const StatType<CountAccumulator>& stat)
 {
 	llassert(!isStarted());
 	return mBuffers->mCounts[stat.getIndex()].getSum();
 }
 
-F64 Recording::getSum( const StatType<EventAccumulator>& stat )
+F64 Recording::getSum( const StatType<EventAccumulator>& stat)
 {
 	llassert(!isStarted());
 	return (F64)mBuffers->mEvents[stat.getIndex()].getSum();
diff --git a/indra/llcommon/lltracerecording.h b/indra/llcommon/lltracerecording.h
index 810f7966662ca0b58c4cb80413863b4571292c5e..4b7a5ef0daccac197b6758e5d4f5a31718f235dc 100644
--- a/indra/llcommon/lltracerecording.h
+++ b/indra/llcommon/lltracerecording.h
@@ -168,6 +168,7 @@ namespace LLTrace
 		void makeUnique() { mBuffers.makeUnique(); }
 
 		// Timer accessors
+		bool hasValue(const StatType<TimeBlockAccumulator>& stat);
 		F64Seconds getSum(const StatType<TimeBlockAccumulator>& stat);
 		F64Seconds getSum(const StatType<TimeBlockAccumulator::SelfTimeFacet>& stat);
 		S32 getSum(const StatType<TimeBlockAccumulator::CallCountFacet>& stat);
@@ -178,22 +179,24 @@ namespace LLTrace
 
 		// Memory accessors
 		bool hasValue(const StatType<MemAccumulator>& stat);
-
 		F64Kilobytes getMin(const StatType<MemAccumulator>& stat);
 		F64Kilobytes getMean(const StatType<MemAccumulator>& stat);
 		F64Kilobytes getMax(const StatType<MemAccumulator>& stat);
 		F64Kilobytes getStandardDeviation(const StatType<MemAccumulator>& stat);
 		F64Kilobytes getLastValue(const StatType<MemAccumulator>& stat);
 
+		bool hasValue(const StatType<MemAccumulator::AllocationFacet>& stat);
 		F64Kilobytes getSum(const StatType<MemAccumulator::AllocationFacet>& stat);
 		F64Kilobytes getPerSec(const StatType<MemAccumulator::AllocationFacet>& stat);
 		S32 getSampleCount(const StatType<MemAccumulator::AllocationFacet>& stat);
 
+		bool hasValue(const StatType<MemAccumulator::DeallocationFacet>& stat);
 		F64Kilobytes getSum(const StatType<MemAccumulator::DeallocationFacet>& stat);
 		F64Kilobytes getPerSec(const StatType<MemAccumulator::DeallocationFacet>& stat);
 		S32 getSampleCount(const StatType<MemAccumulator::DeallocationFacet>& stat);
 
 		// CountStatHandle accessors
+		bool hasValue(const StatType<CountAccumulator>& stat);
 		F64 getSum(const StatType<CountAccumulator>& stat);
 		template <typename T>
 		typename RelatedTypes<T>::sum_t getSum(const CountStatHandle<T>& stat)
@@ -367,13 +370,21 @@ namespace LLTrace
 			S32 total_periods = mNumPeriods;
 			num_periods = llmin(num_periods, isStarted() ? total_periods - 1 : total_periods);
 
-			typename T::value_t min_val = std::numeric_limits<typename T::value_t>::max();
+			bool has_value = false;
+			T::value_t min_val(std::numeric_limits<T::value_t>::max());
 			for (S32 i = 1; i <= num_periods; i++)
 			{
 				Recording& recording = getPrevRecording(i);
-				min_val = llmin(min_val, recording.getSum(stat));
+				if (recording.hasValue(stat))
+				{
+					min_val = llmin(min_val, recording.getSum(stat));
+					has_value = true;
+				}
 			}
-			return min_val;
+
+			return has_value 
+				? min_val 
+				: T::getDefaultValue();
 		}
 
 		template<typename T>
@@ -405,7 +416,7 @@ namespace LLTrace
 			S32 total_periods = mNumPeriods;
 			num_periods = llmin(num_periods, isStarted() ? total_periods - 1 : total_periods);
 
-			typename RelatedTypes<typename T::value_t>::fractional_t min_val = std::numeric_limits<F64>::max();
+			typename RelatedTypes<typename T::value_t>::fractional_t min_val(std::numeric_limits<F64>::max());
 			for (S32 i = 1; i <= num_periods; i++)
 			{
 				Recording& recording = getPrevRecording(i);
@@ -431,13 +442,21 @@ namespace LLTrace
 			S32 total_periods = mNumPeriods;
 			num_periods = llmin(num_periods, isStarted() ? total_periods - 1 : total_periods);
 
-			typename T::value_t max_val = std::numeric_limits<typename T::value_t>::min();
+			bool has_value = false;
+			T::value_t max_val(std::numeric_limits<T::value_t>::min());
 			for (S32 i = 1; i <= num_periods; i++)
 			{
 				Recording& recording = getPrevRecording(i);
-				max_val = llmax(max_val, recording.getSum(stat));
+				if (recording.hasValue(stat))
+				{
+					max_val = llmax(max_val, recording.getSum(stat));
+					has_value = true;
+				}
 			}
-			return max_val;
+
+			return has_value 
+				? max_val 
+				: T::getDefaultValue();
 		}
 
 		template<typename T>
diff --git a/indra/newview/llviewerstats.cpp b/indra/newview/llviewerstats.cpp
index b5aa052a9001c36cb2fd3b6075129f3027481f0f..d5ae2d1030837f995096da39cf7a5cde3adc8bae 100755
--- a/indra/newview/llviewerstats.cpp
+++ b/indra/newview/llviewerstats.cpp
@@ -208,7 +208,7 @@ LLTrace::EventStatHandle<LLUnit<F32, LLUnits::Percent> > OBJECT_CACHE_HIT_RATE("
 LLViewerStats::LLViewerStats() 
 :	mLastTimeDiff(0.0)
 {
-	mRecording.start();
+	getRecording().start();
 }
 
 LLViewerStats::~LLViewerStats()
@@ -216,7 +216,7 @@ LLViewerStats::~LLViewerStats()
 
 void LLViewerStats::resetStats()
 {
-	LLViewerStats::instance().mRecording.reset();
+	getRecording().reset();
 }
 
 void LLViewerStats::updateFrameStats(const F64Seconds time_diff)
@@ -457,6 +457,8 @@ void send_stats()
 		return;
 	}
 	
+	LLViewerStats::instance().getRecording().pause();
+
 	body["session_id"] = gAgentSessionID;
 	
 	LLSD &agent = body["agent"];
@@ -616,6 +618,8 @@ void send_stats()
 	
 	LLViewerStats::getInstance()->addToMessage(body);
 	LLHTTPClient::post(url, body, new ViewerStatsResponder());
+
+	LLViewerStats::instance().getRecording().resume();
 }
 
 LLFrameTimer& LLViewerStats::PhaseMap::getPhaseTimer(const std::string& phase_name)