diff --git a/indra/llcommon/llsingleton.cpp b/indra/llcommon/llsingleton.cpp
index eb8e2c9456e968de5c8c4bd529e9313a421dfdc9..9b49e5237717234ae6ba2179ff053e3a39cf8934 100644
--- a/indra/llcommon/llsingleton.cpp
+++ b/indra/llcommon/llsingleton.cpp
@@ -28,5 +28,4 @@
 
 #include "llsingleton.h"
 
-std::map<std::string, void *> * LLSingletonRegistry::sSingletonMap = NULL;
 
diff --git a/indra/llcommon/llsingleton.h b/indra/llcommon/llsingleton.h
index f6b0a7194b3c1f6a2b83439df9d81d89881fa792..697d1b042a05f9ce5dd310e467ec4250437c06b4 100644
--- a/indra/llcommon/llsingleton.h
+++ b/indra/llcommon/llsingleton.h
@@ -30,38 +30,6 @@
 #include <typeinfo>
 #include <boost/noncopyable.hpp>
 
-/// @brief A global registry of all singletons to prevent duplicate allocations
-/// across shared library boundaries
-class LL_COMMON_API LLSingletonRegistry {
-	private:
-		typedef std::map<std::string, void *> TypeMap;
-		static TypeMap * sSingletonMap;
-
-		static void checkInit()
-		{
-			if(sSingletonMap == NULL)
-			{
-				sSingletonMap = new TypeMap();
-			}
-		}
-
-	public:
-		template<typename T> static void * & get()
-		{
-			std::string name(typeid(T).name());
-
-			checkInit();
-
-			// the first entry of the pair returned by insert will be either the existing
-			// iterator matching our key, or the newly inserted NULL initialized entry
-			// see "Insert element" in http://www.sgi.com/tech/stl/UniqueAssociativeContainer.html
-			TypeMap::iterator result =
-				sSingletonMap->insert(std::make_pair(name, (void*)NULL)).first;
-
-			return result->second;
-		}
-};
-
 // LLSingleton implements the getInstance() method part of the Singleton
 // pattern. It can't make the derived class constructors protected, though, so
 // you have to do that yourself.
@@ -90,10 +58,9 @@ template <typename DERIVED_TYPE>
 class LLSingleton : private boost::noncopyable
 {
 	
-protected:
+private:
 	typedef enum e_init_state
 	{
-		UNINITIALIZED,
 		CONSTRUCTING,
 		INITIALIZING,
 		INITIALIZED,
@@ -109,8 +76,11 @@ class LLSingleton : private boost::noncopyable
 		
 		SingletonInstanceData()
 		:	mSingletonInstance(NULL),
-			mInitState(UNINITIALIZED)
-		{}
+			mInitState(CONSTRUCTING)
+		{
+			mSingletonInstance = new DERIVED_TYPE(); 
+			mInitState = INITIALIZING;
+		}
 
 		~SingletonInstanceData()
 		{
@@ -151,12 +121,12 @@ class LLSingleton : private boost::noncopyable
 	 */
 	static void deleteSingleton()
 	{
-		SingletonInstanceData& data = getSingletonData();
-		delete data.mSingletonInstance;
-		data.mSingletonInstance = NULL;
-		data.mInitState = DELETED;
+		delete getSingletonData().mSingletonInstance;
+		getSingletonData().mSingletonInstance = NULL;
+		getSingletonData().mInitState = DELETED;
 	}
 
+
 	static DERIVED_TYPE* getInstance()
 	{
 		SingletonInstanceData& data = getSingletonData();
@@ -171,13 +141,11 @@ class LLSingleton : private boost::noncopyable
 			llwarns << "Trying to access deleted singleton " << typeid(DERIVED_TYPE).name() << " creating new instance" << llendl;
 		}
 		
-		if (!data.mSingletonInstance) 
+		if (data.mInitState == INITIALIZING) 
 		{
-			data.mInitState = CONSTRUCTING;
-			data.mSingletonInstance = new DERIVED_TYPE(); 
-			data.mInitState = INITIALIZING;
-			data.mSingletonInstance->initSingleton(); 
+			// go ahead and flag ourselves as initialized so we can be reentrant during initialization
 			data.mInitState = INITIALIZED;	
+			data.mSingletonInstance->initSingleton(); 
 		}
 		
 		return data.mSingletonInstance;
@@ -185,7 +153,7 @@ class LLSingleton : private boost::noncopyable
 
 	static DERIVED_TYPE* getIfExists()
 	{
-		SingletonInstanceData& data = getSingletonData();
+		SingletonInstanceData& data = getData();
 		return data.mSingletonInstance;
 	}
 
@@ -211,20 +179,14 @@ class LLSingleton : private boost::noncopyable
 	}
 
 private:
+
 	static SingletonInstanceData& getSingletonData()
 	{
 		// this is static to cache the lookup results
-		static void * & registry = LLSingletonRegistry::get<DERIVED_TYPE>();
-
-		// *TODO - look into making this threadsafe
-		if(NULL == registry)
-		{
-			static SingletonInstanceData data;
-			registry = &data;
-		}
-
-		return *static_cast<SingletonInstanceData *>(registry);
+		static SingletonInstanceData sData;
+		return sData;
 	}
+
 	virtual void initSingleton() {}
 };
 
diff --git a/indra/llcommon/lltracerecording.cpp b/indra/llcommon/lltracerecording.cpp
index 2917c217d79b9aeffa80157bfb331b75b8a18514..e562f2bce216de66664addd94c138d6cc73d9985 100644
--- a/indra/llcommon/lltracerecording.cpp
+++ b/indra/llcommon/lltracerecording.cpp
@@ -362,6 +362,10 @@ PeriodicRecording::PeriodicRecording( U32 num_periods, EPlayState state)
 :	mAutoResize(num_periods == 0),
 	mCurPeriod(0)
 {
+	if (mAutoResize) 
+	{
+		num_periods = 1;
+	}
 	if (num_periods)
 	{
 		mRecordingPeriods.resize(num_periods);
@@ -464,7 +468,61 @@ void PeriodicRecording::appendPeriodicRecording( PeriodicRecording& other )
 	other.setPlayState(other_play_state);
 }
 
+LLUnit<LLUnits::Seconds, F64> PeriodicRecording::getDuration()
+{
+	LLUnit<LLUnits::Seconds, F64> duration;
+	size_t num_periods = mRecordingPeriods.size();
+	for (size_t i = 1; i <= num_periods; i++)
+	{
+		size_t index = (mCurPeriod + num_periods - i) % num_periods;
+		duration += mRecordingPeriods[index].getDuration();
+	}
+	return duration;
+}
+
+
+LLTrace::Recording PeriodicRecording::snapshotCurRecording() const
+{
+	Recording recording_copy(getCurRecording());
+	recording_copy.stop();
+	return recording_copy;
+}
+
 
+Recording& PeriodicRecording::getLastRecording()
+{
+	U32 num_periods = mRecordingPeriods.size();
+	return mRecordingPeriods[(mCurPeriod + num_periods - 1) % num_periods];
+}
+
+const Recording& PeriodicRecording::getLastRecording() const
+{
+	return getPrevRecording(1);
+}
+
+Recording& PeriodicRecording::getCurRecording()
+{
+	return mRecordingPeriods[mCurPeriod];
+}
+
+const Recording& PeriodicRecording::getCurRecording() const
+{
+	return mRecordingPeriods[mCurPeriod];
+}
+
+Recording& PeriodicRecording::getPrevRecording( U32 offset )
+{
+	U32 num_periods = mRecordingPeriods.size();
+	offset = llclamp(offset, 0u, num_periods - 1);
+	return mRecordingPeriods[(mCurPeriod + num_periods - offset) % num_periods];
+}
+
+const Recording& PeriodicRecording::getPrevRecording( U32 offset ) const
+{
+	U32 num_periods = mRecordingPeriods.size();
+	offset = llclamp(offset, 0u, num_periods - 1);
+	return mRecordingPeriods[(mCurPeriod + num_periods - offset) % num_periods];
+}
 
 void PeriodicRecording::start()
 {
@@ -577,6 +635,13 @@ void ExtendableRecording::splitFrom(ExtendableRecording& other)
 // ExtendablePeriodicRecording
 ///////////////////////////////////////////////////////////////////////
 
+
+ExtendablePeriodicRecording::ExtendablePeriodicRecording() 
+:	mAcceptedRecording(0), 
+	mPotentialRecording(0)
+{
+}
+
 void ExtendablePeriodicRecording::extend()
 {
 	// stop recording to get latest data
diff --git a/indra/llcommon/lltracerecording.h b/indra/llcommon/lltracerecording.h
index 23b031b49b9efe7c8a6b8ec2a8039b745ba3839a..84006a10b8592592c18d8734d3c64e8f4e157e67 100644
--- a/indra/llcommon/lltracerecording.h
+++ b/indra/llcommon/lltracerecording.h
@@ -254,49 +254,16 @@ namespace LLTrace
 		void nextPeriod();
 		U32 getNumPeriods() { return mRecordingPeriods.size(); }
 
-		void appendPeriodicRecording(PeriodicRecording& other);
-
-		Recording& getLastRecording()
-		{
-			U32 num_periods = mRecordingPeriods.size();
-			return mRecordingPeriods[(mCurPeriod + num_periods - 1) % num_periods];
-		}
-
-		const Recording& getLastRecording() const
-		{
-			return getPrevRecording(1);
-		}
-
-		Recording& getCurRecording()
-		{
-			return mRecordingPeriods[mCurPeriod];
-		}
-
-		const Recording& getCurRecording() const
-		{
-			return mRecordingPeriods[mCurPeriod];
-		}
-
-		Recording& getPrevRecording(U32 offset)
-		{
-			U32 num_periods = mRecordingPeriods.size();
-			offset = llclamp(offset, 0u, num_periods - 1);
-			return mRecordingPeriods[(mCurPeriod + num_periods - offset) % num_periods];
-		}
+		LLUnit<LLUnits::Seconds, F64> getDuration();
 
-		const Recording& getPrevRecording(U32 offset) const
-		{
-			U32 num_periods = mRecordingPeriods.size();
-			offset = llclamp(offset, 0u, num_periods - 1);
-			return mRecordingPeriods[(mCurPeriod + num_periods - offset) % num_periods];
-		}
-
-		Recording snapshotCurRecording() const
-		{
-			Recording recording_copy(getCurRecording());
-			recording_copy.stop();
-			return recording_copy;
-		}
+		void appendPeriodicRecording(PeriodicRecording& other);
+		Recording& getLastRecording();
+		const Recording& getLastRecording() const;
+		Recording& getCurRecording();
+		const Recording& getCurRecording() const;
+		Recording& getPrevRecording(U32 offset);
+		const Recording& getPrevRecording(U32 offset) const;
+		Recording snapshotCurRecording() const;
 
 		template <typename T>
 		typename T::value_t getPeriodMin(const TraceType<T>& stat, size_t num_periods = U32_MAX) const
@@ -447,10 +414,11 @@ namespace LLTrace
 	:	public LLStopWatchControlsMixin<ExtendablePeriodicRecording>
 	{
 	public:
+		ExtendablePeriodicRecording();
 		void extend();
 
-		PeriodicRecording& getAcceptedRecording() { return mAcceptedRecording; }
-		const PeriodicRecording& getAcceptedRecording() const {return mAcceptedRecording;}
+		PeriodicRecording& getAcceptedRecording()				{ return mAcceptedRecording; }
+		const PeriodicRecording& getAcceptedRecording() const	{return mAcceptedRecording;}
 
 		// implementation for LLStopWatchControlsMixin
 		/*virtual*/ void start();
diff --git a/indra/newview/llscenemonitor.cpp b/indra/newview/llscenemonitor.cpp
index 15fe77f028a4c3276870cefdc3b46b6196c7df6f..7f7e61cc8865b6c9f2df83cb9d33f38026eb1754 100644
--- a/indra/newview/llscenemonitor.cpp
+++ b/indra/newview/llscenemonitor.cpp
@@ -73,7 +73,7 @@ LLSceneMonitor::LLSceneMonitor() :
 	mFrames[0] = NULL;
 	mFrames[1] = NULL;
 
-	mRecording = new LLTrace::ExtendableRecording();
+	mRecording = new LLTrace::ExtendablePeriodicRecording();
 	mRecording->start();
 }
 
diff --git a/indra/newview/llscenemonitor.h b/indra/newview/llscenemonitor.h
index c897b237b65d46c8e10df336251e4719fb637e4d..45a5241924db2839f9d84354b813c8ae7607a55b 100644
--- a/indra/newview/llscenemonitor.h
+++ b/indra/newview/llscenemonitor.h
@@ -63,7 +63,7 @@ class LLSceneMonitor :  public LLSingleton<LLSceneMonitor>
 	bool isEnabled()const {return mEnabled;}
 	bool needsUpdate() const;
 	
-	LLTrace::ExtendableRecording* getRecording() const {return mRecording;}
+	LLTrace::ExtendablePeriodicRecording* getRecording() const {return mRecording;}
 	void dumpToFile(std::string file_name);
 	bool hasResults() const { return !mMonitorResults.empty();}
 
@@ -102,7 +102,7 @@ class LLSceneMonitor :  public LLSingleton<LLSceneMonitor>
 
 	std::vector<LLAnimPauseRequest> mAvatarPauseHandles;
 
-	LLTrace::ExtendableRecording* mRecording;
+	LLTrace::ExtendablePeriodicRecording* mRecording;
 
 	//---------------------------------------
 	typedef struct _monitor_result
diff --git a/indra/newview/lltoolselect.h b/indra/newview/lltoolselect.h
index baa27f607166cad948d28a0cf59b5c4a5214abca..74dababe8c899ca242a976ae590e3a56cf055bb9 100644
--- a/indra/newview/lltoolselect.h
+++ b/indra/newview/lltoolselect.h
@@ -34,7 +34,7 @@
 
 class LLObjectSelection;
 
-class LLToolSelect : public LLTool, public LLSingleton<LLToolSelect>
+class LLToolSelect : public LLTool
 {
 public:
 	LLToolSelect( LLToolComposite* composite );
diff --git a/indra/newview/llviewertexturelist.h b/indra/newview/llviewertexturelist.h
index e3df71cca26fe7f89d4d7a1bb690bb10e72faaf3..7ce4a8fc70d937ff49cc3acf82060028c05e4cbb 100644
--- a/indra/newview/llviewertexturelist.h
+++ b/indra/newview/llviewertexturelist.h
@@ -34,6 +34,7 @@
 #include "llui.h"
 #include <list>
 #include <set>
+#include "lluiimage.h"
 
 const U32 LL_IMAGE_REZ_LOSSLESS_CUTOFF = 128;