Skip to content

Instantly share code, notes, and snippets.

@amirshim
Created May 17, 2013 21:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amirshim/5602245 to your computer and use it in GitHub Desktop.
Save amirshim/5602245 to your computer and use it in GitHub Desktop.
Huge memory leak
def mainLoop() : Unit@cps[Future[Any]] = {
while (true) {
val fut = Promise.successful(new Array[Byte](1000000*100)).future // 100MB
// This shift is the same as Akka DataFlow's DataflowFuture.apply()
val result = shift { onComplete: (Array[Byte] => Future[Any]) =>
fut flatMap onComplete
}
println(result)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment