From bb8022860cd2f094b6c45df73fe1981e878a93d2 Mon Sep 17 00:00:00 2001 From: Jarred Sumner Date: Wed, 5 Mar 2025 06:32:17 -0800 Subject: [PATCH] Update BunGCController.cpp --- src/bun.js/bindings/BunGCController.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/bun.js/bindings/BunGCController.cpp b/src/bun.js/bindings/BunGCController.cpp index 14acdaca79..a03bfd8abb 100644 --- a/src/bun.js/bindings/BunGCController.cpp +++ b/src/bun.js/bindings/BunGCController.cpp @@ -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