Skip to content

Instantly share code, notes, and snippets.

@l15k4
Created January 24, 2017 18:20
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 l15k4/10bc72db6bda91ee42b29708fb767094 to your computer and use it in GitHub Desktop.
Save l15k4/10bc72db6bda91ee42b29708fb767094 to your computer and use it in GitHub Desktop.
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