Log threadcount together with memory
This commit is contained in:
@@ -67,6 +67,7 @@ U32 ll_thread_local local_thread_ID = 0;
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
U32 LLThread::sIDIter = 0;
|
U32 LLThread::sIDIter = 0;
|
||||||
|
LLAtomicS32 LLThread::sCount = 0;
|
||||||
|
|
||||||
LL_COMMON_API void assert_main_thread()
|
LL_COMMON_API void assert_main_thread()
|
||||||
{
|
{
|
||||||
@@ -125,6 +126,8 @@ LLThread::LLThread(std::string const& name) :
|
|||||||
mThreadLocalData(NULL)
|
mThreadLocalData(NULL)
|
||||||
{
|
{
|
||||||
mID = ++sIDIter;
|
mID = ++sIDIter;
|
||||||
|
sCount++;
|
||||||
|
llassert(sCount <= 50);
|
||||||
mRunCondition = new LLCondition;
|
mRunCondition = new LLCondition;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -175,7 +178,7 @@ void LLThread::shutdown()
|
|||||||
}
|
}
|
||||||
mAPRThreadp = NULL;
|
mAPRThreadp = NULL;
|
||||||
}
|
}
|
||||||
|
sCount--;
|
||||||
delete mRunCondition;
|
delete mRunCondition;
|
||||||
mRunCondition = 0;
|
mRunCondition = 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -73,6 +73,7 @@ class LL_COMMON_API LLThread
|
|||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
static U32 sIDIter;
|
static U32 sIDIter;
|
||||||
|
static LLAtomicS32 sCount;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
typedef enum e_thread_status
|
typedef enum e_thread_status
|
||||||
@@ -90,6 +91,7 @@ public:
|
|||||||
bool isStopped() const { return (STOPPED == mStatus); }
|
bool isStopped() const { return (STOPPED == mStatus); }
|
||||||
|
|
||||||
static U32 currentID(); // Return ID of current thread
|
static U32 currentID(); // Return ID of current thread
|
||||||
|
static S32 getCount() { return sCount; }
|
||||||
static void yield(); // Static because it can be called by the main thread, which doesn't have an LLThread data structure.
|
static void yield(); // Static because it can be called by the main thread, which doesn't have an LLThread data structure.
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|||||||
@@ -8156,7 +8156,7 @@
|
|||||||
<key>Type</key>
|
<key>Type</key>
|
||||||
<string>F32</string>
|
<string>F32</string>
|
||||||
<key>Value</key>
|
<key>Value</key>
|
||||||
<real>600.0</real>
|
<real>30.0</real>
|
||||||
</map>
|
</map>
|
||||||
<key>MemoryPrivatePoolEnabled</key>
|
<key>MemoryPrivatePoolEnabled</key>
|
||||||
<map>
|
<map>
|
||||||
|
|||||||
@@ -228,6 +228,7 @@ void display_stats()
|
|||||||
gMemoryAllocated = LLMemory::getCurrentRSS();
|
gMemoryAllocated = LLMemory::getCurrentRSS();
|
||||||
U32 memory = (U32)(gMemoryAllocated / (1024*1024));
|
U32 memory = (U32)(gMemoryAllocated / (1024*1024));
|
||||||
llinfos << llformat("MEMORY: %d MB", memory) << llendl;
|
llinfos << llformat("MEMORY: %d MB", memory) << llendl;
|
||||||
|
llinfos << "THREADS: "<< LLThread::getCount() << llendl;
|
||||||
LLMemory::logMemoryInfo(TRUE) ;
|
LLMemory::logMemoryInfo(TRUE) ;
|
||||||
gRecentMemoryTime.reset();
|
gRecentMemoryTime.reset();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user