summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/app_settings/settings.xml2
-rw-r--r--indra/newview/llvocache.cpp20
-rw-r--r--indra/newview/llvocache.h2
3 files changed, 15 insertions, 9 deletions
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 819808ec40..ced46c7294 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -1179,7 +1179,7 @@
<key>Type</key>
<string>U32</string>
<key>Value</key>
- <integer>20000</integer>
+ <integer>128</integer>
</map>
<key>CacheSize</key>
<map>
diff --git a/indra/newview/llvocache.cpp b/indra/newview/llvocache.cpp
index 1e2736f7d9..b3312db4a0 100644
--- a/indra/newview/llvocache.cpp
+++ b/indra/newview/llvocache.cpp
@@ -517,6 +517,11 @@ void LLVOCache::readCacheHeader()
{
removeCache() ; //failed to read header, clear the cache
}
+ else if(mNumEntries >= mCacheSize)
+ {
+ purgeEntries(mCacheSize) ;
+ }
+
return ;
}
@@ -644,9 +649,9 @@ void LLVOCache::readFromCache(U64 handle, const LLUUID& id, LLVOCacheEntry::voca
return ;
}
-void LLVOCache::purgeEntries()
+void LLVOCache::purgeEntries(U32 size)
{
- while(mHeaderEntryQueue.size() >= mCacheSize)
+ while(mHeaderEntryQueue.size() >= size)
{
header_entry_queue_t::iterator iter = mHeaderEntryQueue.begin() ;
HeaderEntryInfo* entry = *iter ;
@@ -671,16 +676,17 @@ void LLVOCache::writeToCache(U64 handle, const LLUUID& id, const LLVOCacheEntry:
{
llwarns << "Not writing cache for handle " << handle << "): Cache is currently in read-only mode." << llendl;
return ;
- }
- if(mNumEntries >= mCacheSize)
- {
- purgeEntries() ;
- }
+ }
HeaderEntryInfo* entry;
handle_entry_map_t::iterator iter = mHandleEntryMap.find(handle) ;
if(iter == mHandleEntryMap.end()) //new entry
{
+ if(mNumEntries >= mCacheSize - 1)
+ {
+ purgeEntries(mCacheSize - 1) ;
+ }
+
entry = new HeaderEntryInfo();
entry->mHandle = handle ;
entry->mTime = time(NULL) ;
diff --git a/indra/newview/llvocache.h b/indra/newview/llvocache.h
index 1070fcaae9..14e3b4c793 100644
--- a/indra/newview/llvocache.h
+++ b/indra/newview/llvocache.h
@@ -130,7 +130,7 @@ private:
void clearCacheInMemory();
void removeCache() ;
void removeEntry(HeaderEntryInfo* entry) ;
- void purgeEntries();
+ void purgeEntries(U32 size);
BOOL updateEntry(const HeaderEntryInfo* entry);
private: