diff --git a/core/src/main/scala/org/apache/spark/rapids/tool/benchmarks/Benchmark.scala b/core/src/main/scala/org/apache/spark/rapids/tool/benchmarks/Benchmark.scala index a09f121ad..45ad3bdd4 100644 --- a/core/src/main/scala/org/apache/spark/rapids/tool/benchmarks/Benchmark.scala +++ b/core/src/main/scala/org/apache/spark/rapids/tool/benchmarks/Benchmark.scala @@ -104,6 +104,7 @@ class Benchmark( val gcTimes = ArrayBuffer[Long]() //For tracking maximum GC over iterations for (i <- 0 until minIters) { + System.gc() // ensures GC for a consistent state across different iterations val timer = new ToolsTimer(i) val memoryTracker = new MemoryMetricsTracker f(timer)