I have the following method:
public static void createGiantArray(int size) {
int[][][] giantArray = new int[size][size][size];
}
When I call it with a size of 10,000 like so:
createGiantArray(10000);
I get the following error:
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
How can I create an array that is 10,000 x 10,000 x 10,000 while bypassing the memory exception?
(I am aware my current method is pointless and loses scope. I didn't post the extra code that goes with it.)