Skip to content

Commit

Permalink
Call System.gc for each iteration
Browse files Browse the repository at this point in the history
  • Loading branch information
Atry committed Jun 1, 2018
1 parent 2a5efc2 commit 10b34e4
Showing 1 changed file with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ object benchmark {
@State(Scope.Benchmark)
class FourLayer {

@Param(Array("4"))
@Param(Array("8"))
protected var batchSize: Int = _

@Param(Array("1", "2", "4"))
Expand Down Expand Up @@ -170,10 +170,15 @@ object benchmark {

@Benchmark
final def deepLearningDotScala(): Double = {
val (coarseClass, batch) = batches.synchronized {
batches.next()
try {
val (coarseClass, batch) = batches.synchronized {
batches.next()
}
model.train(coarseClass, batch).blockingAwait
} finally {
System.gc()
System.gc()
}
model.train(coarseClass, batch).blockingAwait
}

}
Expand Down

0 comments on commit 10b34e4

Please sign in to comment.