Open Mrhs121 opened 1 year ago
I'm alos trying to create huge array of Object:
val arr = LArray.of[AnyRef](10L + Integer.MAX_VALUE)
failed with exception:
Exception in thread "main" java.lang.OutOfMemoryError: Requested array size exceeds VM limit
at scala.reflect.ManifestFactory$ObjectManifest.newArray(Manifest.scala:258)
at scala.reflect.ManifestFactory$ObjectManifest.newArray(Manifest.scala:257)
at xerial.larray.LObjectArrayLarge.$anonfun$array$1(LArray.scala:1150)
at xerial.larray.LObjectArrayLarge$$Lambda$5/510113906.apply$mcVI$sp(Unknown Source)
at scala.collection.immutable.Range.foreach$mVc$sp(Range.scala:158)
at xerial.larray.LObjectArrayLarge.<init>(LArray.scala:1148)
at xerial.larray.LObjectArray$.ofDim(LArray.scala:1061)
at xerial.larray.LArray$.of(LArray.scala:403)
at org.example.App$.testBigArray(App.scala:42)
at org.example.App$.main(App.scala:102)
at org.example.App.main(App.scala)
It seems the project is in a maintenance state and it looks to be difficult to create new versions. The author has been working in another similar project (see https://github.com/xerial/larray/issues/75#issuecomment-1327176483).
Anyway, for future readers, remember that Foreign Memory API (JEP 454) is production ready in Java 22 and AFAIK it covers all features from this library without needing to use JNI.
Will this bug continue to be fixed? #63
I have adopted his patch, but the error of 'requested array size exceeds vm limit' still occurs.
Looking forward to fixing this bug.