Hello! I can create a sheet with 10000 rows. When I try to create a sheet with 30000 rows I get an OutOfMemoryError. Greetings from Germany Holger P.S. I tried the VM argument "-Xmx128m" (J2SE 1.4.1) without any effect. public static void main(String[] args) throws IOException { HSSFWorkbook workbook = new HSSFWorkbook(); HSSFSheet sheet = workbook.createSheet("Test"); for (short i = 1; i < 30000; i++) { HSSFRow row = sheet.createRow(i); for (short j = 0; j < 50; j++) { row.createCell(j).setCellValue("content"); } } FileOutputStream fos = new FileOutputStream("c:/temp/linetest.xls"); workbook.write(fos); }
If you have that much data, you need to give POI enough memory. try mx256M. Poi is memory hungry in many ways. There is an effort going on to make it more space efficient, but that effort will not be complete any time soon.