Created
October 9, 2017 12:45
-
-
Save dragos/93b50aaf75640c6d484e41f085ee9290 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object Main { | |
private var things: Array[Object] = null | |
def allocate(size: Int): Unit = { | |
things = new Array[Object](size) | |
Array.fill(size)(new Object) | |
} | |
def main(args: Array[String]): Unit = { | |
val size: Int = args match { | |
case Array(n, _*) => Integer.parseInt(n) | |
case _ => 100000000 | |
} | |
while (true) { | |
println() | |
println(s"Allocating $size elements") | |
allocate(size) | |
println("Press enter to run GC") | |
io.StdIn.readLine() | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment