You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 19, 2020. It is now read-only.
This ends up with java.lang.OutOfMemoryError: GC overhead limit exceeded even if I use -Xmx4096 even though theoretically it should need only Int.MaxValue/16 * 8 so -Xmx2048m tops
If I measure the resulting Array using SizeEstimator.scala it has 3758MB which is 27B per element, which is a offheap.Array value class that should break down to 8 bytes long only but it obviously doesn't.
It's probably my misuse of scala Value Classes, I think that if I do this scala.Array[offheap.Array[Byte]](x,y,z) then it doesn't matter then offheap.Array is a value class and it breaks down to a normal x, y, z instances on heap which I didn't expect to happen.
$ java -version
openjdk version "1.8.0_111"
OpenJDK Runtime Environment (build 1.8.0_111-8u111-b14-2ubuntu0.16.04.2-b14)
OpenJDK 64-Bit Server VM (build 25.111-b14, mixed mode)
And scala version from scala-offheap project
The text was updated successfully, but these errors were encountered:
Scala currently stores arrays of value classes in a boxed representation, and, I'd assume, that by the time scala-native comes, there's not much one can do with it.
Dotty had a prototype in works that would support storing arrays of value classes efficiently scala/scala3#1228
@DarkDimius btw can you see a reason why offheap.Array is not Allocatable ? So that one could have offheap array of arrays ? Size is known upfront for memory alignment, so it could be doable, right?
It would help for building other collection types like Map
Hey,
I think that the value classes that hold allocation address put significant on-heap memory and GC overhead :
This ends up with
java.lang.OutOfMemoryError: GC overhead limit exceeded
even if I use-Xmx4096
even though theoretically it should need onlyInt.MaxValue/16 * 8
so-Xmx2048m
topsIf I measure the resulting Array using SizeEstimator.scala it has
3758MB
which is27B
per element, which is aoffheap.Array
value class that should break down to 8 bytes long only but it obviously doesn't.It's probably my misuse of scala Value Classes, I think that if I do this
scala.Array[offheap.Array[Byte]](x,y,z)
then it doesn't matter thenoffheap.Array
is a value class and it breaks down to a normalx, y, z
instances on heap which I didn't expect to happen.And scala version from
scala-offheap
projectThe text was updated successfully, but these errors were encountered: