在 Java 中处理超过 20 亿个元素的大数组

Working with larger that 2 billion elements big-arrays in Java

我经常不得不在 Java 中使用大型数组,不断测试 ~2B 元素限制。

有没有一种方便的方法来处理更大的数组?我需要的操作列表:

P.S. 看来这个问题已经被不少工程师思考过了。可以在以下位置找到带有参考的好文章:https://www.nayuki.io/page/large-arrays-proposal-for-java

我建议 fastutil library. I use it mainly for the space-efficient Java collections (using primitive arrays internally), but there's also a section about Big data structures 用于包含 > 2^31 个元素的集合。