aboutsummaryrefslogtreecommitdiff
path: root/zenserver/cache/structuredcachestore.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'zenserver/cache/structuredcachestore.cpp')
-rw-r--r--zenserver/cache/structuredcachestore.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/zenserver/cache/structuredcachestore.cpp b/zenserver/cache/structuredcachestore.cpp
index de5bccc3a..66f32c858 100644
--- a/zenserver/cache/structuredcachestore.cpp
+++ b/zenserver/cache/structuredcachestore.cpp
@@ -773,7 +773,7 @@ ZenCacheDiskLayer::CacheBucket::GatherReferences(GcContext& GcCtx)
return Entry.LastAccess < Ticks;
});
- Cids.reserve(Entries.size());
+ Cids.reserve(1024);
for (auto Kv = ValidIt; Kv != Entries.end(); ++Kv)
{
@@ -791,10 +791,13 @@ ZenCacheDiskLayer::CacheBucket::GatherReferences(GcContext& GcCtx)
if (CacheValue.Value)
{
ZEN_ASSERT(CacheValue.Value.GetContentType() == ZenContentType::kCbObject);
-
+ if (Cids.size() > 1024)
+ {
+ GcCtx.ContributeCids(Cids);
+ Cids.clear();
+ }
CbObject Obj(SharedBuffer{CacheValue.Value});
Obj.IterateAttachments([&Cids](CbFieldView Field) { Cids.push_back(Field.AsAttachment()); });
- GcCtx.ContributeCids(Cids);
}
}
}