Representing a 100K X 100K matrix in Java

后端 未结 9 2072
名媛妹妹
名媛妹妹 2020-12-30 13:45

How can I store a 100K X 100K matrix in Java?

I can\'t do that with a normal array declaration as it is throwing a java.lang.OutofMemoryError.

9条回答
  •  没有蜡笔的小新
    2020-12-30 14:11

    Unless you have 100K x 100K x 8 ~ 80GB of memory, you cannot create this matrix in memory. You can create this matrix on disk and access it using memory mapping. However, using this approach will be very slow.

    What are you trying to do? You may find that representing your data in a different way will be much more efficient.

提交回复
热议问题