Skip to content

Instantly share code, notes, and snippets.

@l15k4
Created Jan 24, 2017
Embed
What would you like to do?
object Play extends App {
implicit val alloc = offheap.malloc
val arr = new scala.Array[offheap.Array[Byte]](Int.MaxValue/8)
var counter = 0
while (counter < Int.MaxValue/8) {
arr(counter) = offheap.Array.fromArray("foobar".getBytes)
counter+=1
}
}
@l15k4
Copy link
Author

l15k4 commented Jan 24, 2017

If you run this with -Xmx4096 it crashes with java.lang.OutOfMemoryError: GC overhead limit exceeded

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment