Update BunGCController.cpp

This commit is contained in:
Jarred Sumner
2025-03-05 06:32:17 -08:00
parent b016940508
commit bb8022860c

View File

@@ -313,10 +313,8 @@ void BunGCController::performOpportunisticGC()
} else if (m_hasStayedTheSameFor < 10) {
// If memory usage plateaus, still do Eden collections
if (!hasMoreEventLoopWorkToDo() && !Bun__isBusyDoingImportantWork(bunVM)) {
if (m_edenCallback->scheduleCollection(m_vm, false)) {
m_hasStayedTheSameFor++;
}
if (m_edenCallback->scheduleCollection(m_vm, !hasMoreEventLoopWorkToDo() && !Bun__isBusyDoingImportantWork(bunVM))) {
m_hasStayedTheSameFor++;
}
} else {
// After long plateau, occasionally do full collection to compact memory