From 6d1fe4c4f7e2bb1cc3d2f2904b81caabd788ed53 Mon Sep 17 00:00:00 2001 From: Ivan Razumov Date: Tue, 28 Jan 2025 16:10:21 +0100 Subject: [PATCH] Avoid inf average values in SimpleMemoryCheck --- FWCore/Services/plugins/SimpleMemoryCheck.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/FWCore/Services/plugins/SimpleMemoryCheck.cc b/FWCore/Services/plugins/SimpleMemoryCheck.cc index 98fb253ae5a62..f401de42c89fc 100644 --- a/FWCore/Services/plugins/SimpleMemoryCheck.cc +++ b/FWCore/Services/plugins/SimpleMemoryCheck.cc @@ -436,7 +436,7 @@ namespace edm { } double SimpleMemoryCheck::averageGrowthRate(double current, double past, int count) { - return (current - past) / (double)count; + return (current - past) / (double)std::max(count, 1); } SimpleMemoryCheck::SimpleMemoryCheck(ParameterSet const& iPS, ActivityRegistry& iReg)