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.
If the vast majority of entries in your matrix will be zero (or even some other constant value) a sparse matrix will be suitable. Otherwise it might be possible to rewrite your algorithm so that the whole matrix doesn't exist simultaneously. You could produce and consume one row at a time, for example.