Skip to content

Commit

Permalink
Trigger GC at the beginning of each benchmark iteration (#1424)
Browse files Browse the repository at this point in the history
Signed-off-by: Ahmed Hussein (amahussein) <[email protected]>

Contributes to #1423

Trigger a GC at the beginning of each benchmark iteration
  • Loading branch information
amahussein authored Nov 15, 2024
1 parent 16195ab commit 197d7eb
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 197d7eb

Please sign in to comment.