diff --git a/native_engine/impl/ark/ark_idle_monitor.cpp b/native_engine/impl/ark/ark_idle_monitor.cpp index e45c1f2ff4e824032e1e7bcb3118696754af4ffb..0a01eb549742477220fe804c175d22ea05ffd4c9 100644 --- a/native_engine/impl/ark/ark_idle_monitor.cpp +++ b/native_engine/impl/ark/ark_idle_monitor.cpp @@ -169,13 +169,13 @@ void ArkIdleMonitor::IntervalMonitor() int64_t intervalDuration = nowTimestamp - intervalTimestamp_; if (numberOfLowIdleNotifyCycles_ >= checkCounts && numberOfHighIdleTimeRatio_ >= checkCounts && - intervalDuration < DELAY_OVER_TIME) { + intervalDuration < static_cast(DELAY_OVER_TIME)) { NotifyMainThreadTryCompressGC(); PostMonitorTask(SLEEP_MONITORING_INTERVAL); ClearIdleStats(); } else if (numberOfLowIdleNotifyCycles_ >= workThreadCheckCounts && numberOfHighIdleTimeRatio_ >= workThreadCheckCounts && - intervalDuration < DELAY_OVER_TIME) { + intervalDuration < static_cast(DELAY_OVER_TIME)) { NotifyOneWorkerThreadTryCompressGC(); PostMonitorTask(IDLE_MONITORING_INTERVAL); } else { @@ -446,8 +446,8 @@ void ArkIdleMonitor::SwitchBackgroundCheckGCTask(int64_t timestamp, int64_t idle int64_t sumIdleDuration = (GetTotalIdleDuration() - idleDuration) + (nowTimestamp - GetNotifyTimestamp()); double idlePercentage = static_cast(sumIdleDuration) / static_cast(sumDuration); double cpuUsage = GetCpuUsage(); - if (idlePercentage > BACKGROUND_IDLE_RATIO && cpuUsage <= IDLE_BACKGROUND_CPU_USAGE - && sumDuration < DELAY_OVER_TIME) { + if (idlePercentage > BACKGROUND_IDLE_RATIO && cpuUsage <= IDLE_BACKGROUND_CPU_USAGE && + sumDuration < static_cast(DELAY_OVER_TIME)) { NotifyMainThreadTryCompressGCByBackground(); } else { HILOG_INFO("ArkIdleMonitor cancel BGGCTask,idlePer:%{public}.2f;cpuUsage:%{public}.2f;duration:%{public}s",