Hi I'm reading data from .xls
sheet it contains 8500
rows of data and I'm trying to store it in double[][]
but I'm getting an error
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
Code
public static double[][] getData_DoubleArray(String path, int sheetNo, int rowIndex1, int rowIndex2) {
double[][] doubleArray=null;
try {
HSSFSheet sheet = PS_ExcelReader.getWorkSheet(path,sheetNo);
System.out.println("sheet" + sheet);
List<Object> data1 = PS_ExcelReader.getFullColumnByIndex(sheet, rowIndex1);
List<Object> data2 = PS_ExcelReader.getFullColumnByIndex(sheet, rowIndex2);
doubleArray = new double[data1.size()][data2.size()];
for(int i = 0; i < data1.size(); i++) {
for(int j = 0; j < data2.size(); j++) {
doubleArray[i][0] = (Double)data1.get(i);
doubleArray[i][1] = (Double)data2.get(j);
}
}
System.out.println("array " + Arrays.deepToString(doubleArray));
}
catch(IOException ioe) {
log.error("data mis match");
}
return doubleArray;
}