I think this is the problem with POI , ie the large memory maps are beeing created by POI api I think you need to limit the size of your documnt .
-----Original Message----- From: LiuGuoMing [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 16, 2006 7:54 AM To: POI Users List Subject: 'java.lang.OutOfMemoryError: Java heap space' Hi,ALL I'm currently using POI to generate some fairly large Excel files (30,000+ rows), using the org.apache.poi.hssf.usermodel package. it occur 'java.lang.OutOfMemoryError: Java heap space' when run it. my code: strSQL = "select * from mydatabase"; QueryData qryData = dbcmd.selQuery(strSQL); // note: qryData.size() >2,0000 if (qryData.size() > 0) for (int i = 0;i < qryData.size();i++){ row=sheet.createRow((short)currRow); cell = row.createCell((short)0); cell.setCellValue(qryData.getRow(i).get("ID")); cell = row.createCell((short)1); cell.setCellValue(qryData.getRow(i).get("NAME")); cell = row.createCell((short)2); cell.setEncoding(HSSFCell.ENCODING_UTF_16); cell.setCellValue(qryData.getRow(i).get("ADDRESS")); cell = row.createCell((short)3); cell.setCellValue(qryData.getRow(i).get("TEL")); cell = row.createCell((short)4); cell.setCellValue(qryData.getRow(i).get("ORDERBY")); cell = row.createCell((short)5); cell.setCellValue(qryData.getRow(i).get("LINKID")); cell = row.createCell((short)6); cell.setCellValue(qryData.getRow(i).get("CSTATUS")); cell = row.createCell((short)7); cell.setCellValue(qryData.getRow(i).get("NTATUS")); cell = row.createCell((short)8); cell.setCellValue(qryData.getRow(i).get("FLG")); System.out.println(currRow); currRow=currRow+1; } } --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] Mailing List: http://jakarta.apache.org/site/mail2.html#poi The Apache Jakarta Poi Project: http://jakarta.apache.org/poi/ --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] Mailing List: http://jakarta.apache.org/site/mail2.html#poi The Apache Jakarta Poi Project: http://jakarta.apache.org/poi/
