aboutsummaryrefslogtreecommitdiff
path: root/zenstore/gc.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'zenstore/gc.cpp')
-rw-r--r--zenstore/gc.cpp21
1 files changed, 13 insertions, 8 deletions
diff --git a/zenstore/gc.cpp b/zenstore/gc.cpp
index 5aff20e7a..bf04543b5 100644
--- a/zenstore/gc.cpp
+++ b/zenstore/gc.cpp
@@ -50,9 +50,9 @@ struct GcContext::GcState
CasChunkSet m_CasChunks;
CasChunkSet m_CidChunks;
GcClock::TimePoint m_GcTime;
- GcClock::Duration m_MaxCacheDuration = std::chrono::hours(24);
- bool m_DeletionMode = true;
- bool m_ContainerGcEnabled = false;
+ GcClock::Duration m_MaxCacheDuration = std::chrono::hours(24);
+ bool m_DeletionMode = true;
+ bool m_CollectSmallObjects = false;
};
GcContext::GcContext(GcClock::TimePoint Time) : m_State(std::make_unique<GcState>())
@@ -107,15 +107,15 @@ GcContext::SetDeletionMode(bool NewState)
}
bool
-GcContext::IsContainerGcEnabled() const
+GcContext::CollectSmallObjects() const
{
- return m_State->m_ContainerGcEnabled;
+ return m_State->m_CollectSmallObjects;
}
void
-GcContext::SetContainerGcEnabled(bool NewState)
+GcContext::CollectSmallObjects(bool NewState)
{
- m_State->m_ContainerGcEnabled = NewState;
+ m_State->m_CollectSmallObjects = NewState;
}
GcClock::TimePoint
@@ -346,7 +346,12 @@ GcScheduler::SchedulerThread()
GcContext GcCtx;
GcCtx.SetDeletionMode(true);
- GcCtx.SetContainerGcEnabled(true);
+ GcCtx.CollectSmallObjects(m_Config.CollectSmallObjects);
+ GcCtx.MaxCacheDuration(m_Config.MaxCacheDuration);
+
+ ZEN_DEBUG("collecting small objects {}, max cache duration {}s",
+ m_Config.CollectSmallObjects ? "YES"sv : "NO"sv,
+ m_Config.MaxCacheDuration.count());
m_CasGc.CollectGarbage(GcCtx);