java.lang.outofmemory Problem

am parsing Excel file which contains 64k records by using jakartha POI Packages.

while loading the file am getting java.lang.outofmemory error.

can please help me how to resolve this problem.

code is as follows

ArrayList list = new ArrayList();

FileInputStream myxls = new FileInputStream("test.xls"); HSSFWorkbook wb= new HSSFWorkbook(myxls);

HSSFSheet sheet = wb.getSheetAt(0);// first sheet//

HSSFRow row= sheet.getRow(0); //first row

int rows = sheet.getLastRowNum();

for (int k=0; k < rows ; k++){

HSSFRow row= sheet.getRow(k);

HSSFCell compoundCell = row.getCell((short)0);

System.out.println(compoundCell.getNumericCellValue());

list.add(new Double(k));

System.out.println("row no >"+k);

}

[805 byte] By [rsk2050a] at [2007-10-3 9:15:04]
# 1
You need to increase the Java Heap size, or not read in everything at once.
zadoka at 2007-7-15 4:27:40 > top of Java-index,Desktop,Core GUI APIs...