poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sumit_Mac...@external.mckinsey.com
Subject RE: 'java.lang.OutOfMemoryError: Java heap space'
Date Tue, 16 May 2006 13:33:28 GMT
Liu,
        It would be good to know what your JVM memory settings are 
currently. Xmin and XMax settings can be tweaked to increase the memory 
available.. try changing that to at least 512MB Max if it is less..
I had the same problem.. only that I was creating excelfiles a bit more 
bulkier than yours... I did two things to resolve it.. a. increase the JVM 
memory and b. redesign it to reduce the data in excelfiles. 

Regards,
Sumit 




"Birendar Waldiya" <bwaldiya@cisco.com> 
05/16/2006 12:13 AM
Please respond to
"POI Users List" <poi-user@jakarta.apache.org>


To
"'POI Users List'" <poi-user@jakarta.apache.org>
cc

Subject
RE: 'java.lang.OutOfMemoryError: Java heap space'






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:gmliu@sytdc.com] 
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: poi-user-unsubscribe@jakarta.apache.org
Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/

---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/





+=========================================================+
This message may contain confidential and/or privileged
information.  If you are not the addressee or authorized to
receive this for the addressee, you must not use, copy,
disclose or take any action based on this message or any
information herein.  If you have received this message in
error, please advise the sender immediately by reply e-mail
and delete this message.  Thank you for your cooperation.
+=========================================================+

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message