From c561b1a86152a6723c2795a23e411aeecf0e798b Mon Sep 17 00:00:00 2001 From: Alexander Shabalin Date: Tue, 27 Sep 2022 17:25:18 +0000 Subject: [PATCH] [K/N] Manually compact mimalloc heap with stms ^KT-53182 Merge-request: KT-MR-7222 Merged-by: Alexander Shabalin --- .../runtime/src/gc/stms/cpp/SameThreadMarkAndSweep.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kotlin-native/runtime/src/gc/stms/cpp/SameThreadMarkAndSweep.cpp b/kotlin-native/runtime/src/gc/stms/cpp/SameThreadMarkAndSweep.cpp index 5f33570b475..165efed3a31 100644 --- a/kotlin-native/runtime/src/gc/stms/cpp/SameThreadMarkAndSweep.cpp +++ b/kotlin-native/runtime/src/gc/stms/cpp/SameThreadMarkAndSweep.cpp @@ -173,6 +173,8 @@ bool gc::SameThreadMarkAndSweep::PerformFullGC() noexcept { auto timeSweepUs = konan::getTimeMicros(); RuntimeLogDebug({kTagGC}, "Sweeped in %" PRIu64 " microseconds", timeSweepUs - timeSweepExtraObjectsUs); + kotlin::compactObjectPoolInMainThread(); + // Can be unsafe, because we've stopped the world. auto objectsCountAfter = objectFactory_.GetSizeUnsafe(); auto extraObjectsCountAfter = mm::GlobalData::Instance().extraObjectDataFactory().GetSizeUnsafe();