Created
July 23, 2013 20:40
-
-
Save dacr/6065971 to your computer and use it in GitHub Desktop.
This file contains 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
#!/bin/sh | |
exec scala -J-Xms80m -J-Xmx80m -deprecation -nocompdaemon "$0" "$@" | |
!# | |
def allocate(szInMb:Int=24) = | |
Array.fill[Byte](1024*1024*szInMb)(util.Random.nextInt(256).toByte) | |
def allocally[A](proc: => A) {proc} | |
def testit = { | |
val showStep = {var s=0 ; () => {s+=1 ; println(s"step$s")}} | |
allocally { showStep(); val x= allocate(20) } | |
allocally { showStep(); val x= allocate(20) } | |
allocally { showStep(); val x= allocate(20) } | |
allocally { showStep(); val x= allocate(20) } | |
} | |
testit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment