diff --git a/indra/llcommon/lllog.cpp b/indra/llcommon/lllog.cpp
index 178f02e215a095dd7e662de66150531af49b6599..b75a07bf2474b2a802e76f5371ed5b0c644adb17 100644
--- a/indra/llcommon/lllog.cpp
+++ b/indra/llcommon/lllog.cpp
@@ -45,8 +45,8 @@ class LLLogImpl
 	LLLogImpl(LLApp* app) : mApp(app) {}
 	~LLLogImpl() {}
 
-	void log(const std::string message, LLSD& info);
-	bool useLegacyLogMessage(const std::string message);
+	void log(const std::string &message, LLSD& info);
+	bool useLegacyLogMessage(const std::string &message);
 
 private:
 	LLApp* mApp;
@@ -54,7 +54,7 @@ class LLLogImpl
 
 
 //@brief Function to log a message to syslog for streambase to collect.
-void LLLogImpl::log(const std::string message, LLSD& info)
+void LLLogImpl::log(const std::string &message, LLSD& info)
 {
 	static S32 sequence = 0;
     LLSD log_config = mApp->getOption("log-messages");
@@ -74,7 +74,7 @@ void LLLogImpl::log(const std::string message, LLSD& info)
 }
 
 //@brief Function to check if specified legacy log message should be sent.
-bool LLLogImpl::useLegacyLogMessage(const std::string message)
+bool LLLogImpl::useLegacyLogMessage(const std::string &message)
 {
     LLSD log_config = mApp->getOption("log-messages");
 	if (log_config.has(message))
@@ -100,12 +100,12 @@ LLLog::~LLLog()
 	mImpl = NULL;
 }
 
-void LLLog::log(const std::string message, LLSD& info)
+void LLLog::log(const std::string &message, LLSD& info)
 {
 	if (mImpl) mImpl->log(message, info);
 }
 
-bool LLLog::useLegacyLogMessage(const std::string message)
+bool LLLog::useLegacyLogMessage(const std::string &message)
 {
 	if (mImpl)
 	{
diff --git a/indra/llcommon/lllog.h b/indra/llcommon/lllog.h
index ca71ca442cbbf7800062908c7f5c39023918f5b9..9184ca6508bd8360a6d4230c05f24a438bd4b47e 100644
--- a/indra/llcommon/lllog.h
+++ b/indra/llcommon/lllog.h
@@ -46,8 +46,8 @@ class LLLog
 	LLLog(LLApp* app);
 	virtual ~LLLog();
 
-	virtual void log(const std::string message, LLSD& info);
-	virtual bool useLegacyLogMessage(const std::string message);
+	virtual void log(const std::string &message, LLSD& info);
+	virtual bool useLegacyLogMessage(const std::string &message);
 
 private:
 	LLLogImpl* mImpl;
diff --git a/indra/lscript/lscript_execute.h b/indra/lscript/lscript_execute.h
index 2f67e77c93953b891c7dc66194f4678c1392e982..c0a0afa71c425c86ff2a7d649e6b0d4d089a5b14 100644
--- a/indra/lscript/lscript_execute.h
+++ b/indra/lscript/lscript_execute.h
@@ -402,6 +402,8 @@ class LLScriptExecute
 	virtual U32 getBytecodeSize() const = 0;
 	virtual bool isMono() const = 0;
 	virtual void error() {;} // Processing that must be performed when error flag is set and so run is not called.
+
+	virtual U32 getUsedMemory() = 0;
 	
 	// Run current event handler for a maximum of time_slice seconds.
 	// Updates current handler and current events registers.
@@ -493,7 +495,7 @@ class LLScriptExecuteLSL2 : public LLScriptExecute
 	virtual const U8* getBytecode() const {return mBytecode;}
 	virtual U32 getBytecodeSize() const {return mBytecodeSize;}
 	virtual bool isMono() const {return false;}
-
+	virtual U32 getUsedMemory();
 	// Run current event handler for a maximum of time_slice seconds.
 	// Updates current handler and current events registers.
 	virtual void resumeEventHandler(BOOL b_print, const LLUUID &id, F32 time_slice);
diff --git a/indra/lscript/lscript_execute/lscript_execute.cpp b/indra/lscript/lscript_execute/lscript_execute.cpp
index 6280719748ecd573db6c0d868e5936592545d7bb..fff005b7bcd5a5df4f31463765e50e82614a981e 100644
--- a/indra/lscript/lscript_execute/lscript_execute.cpp
+++ b/indra/lscript/lscript_execute/lscript_execute.cpp
@@ -744,6 +744,11 @@ S32 LLScriptExecuteLSL2::getMajorVersion() const
 	return major_version;
 }
 
+U32 LLScriptExecuteLSL2::getUsedMemory()
+{
+	return getBytecodeSize();
+}
+
 LLScriptExecute::LLScriptExecute() :
 	mReset(FALSE)
 {