English 中文(简体)
JAVA - Out Of Memory Error while written Excel cell in jxl
原标题:JAVA - Out Of Memory Error while writing Excel Cells in jxl

I am using JXL to write an excel file of 50000 rows and 30 columns. My code looks like this:

(j++) 页: 1

myWritableSheet.addCell(new Label(0, j, myResultSet.getString(1), myWritableCellFormat));

myWritableSheet.addCell(new Label(1, j, myResultSet.getString(2), myWritableCellFormat));

.....

.....

iii

在撰写囚室时,方案进展缓慢,速度缓慢。

并最终在25 000左右 我正在犯以下错误:

Exception in thread "Thread-3" java.lang.OutOfMemoryError: Java heap space at jxl.write.biff.WritableSheetImpl.getRowRecord(WritableSheetImpl.java:984) at jxl.write.biff.WritableSheetImpl.addCell(WritableSheetImpl.java:951) at KLL.ConverterMainFrame$exportToXLSBillRightsThread.run(ConverterMainFrame.java:6895)

Java总是难以处理记忆。

在本案中,这似乎是一个棘手的问题。

是否有办法每1 000个囚室书写档案、清除记忆和书写细胞?

这是一种好的想法,或者你会提出什么解决办法?

最佳回答

能否向考试和测验科(Xms和-Xmx)提供记忆不是选择吗?

问题回答




相关问题
import of excel in SQL imports NULL lines

I have a stored procedure that imports differently formatted workbooks into a database table, does work on them then drops the table. Here is the populating query. SELECT IDENTITY(INT,1,1) AS ID ...

Connecting to Oracle 10g with ODBC from Excel VBA

The following code works. the connection opens fine but recordset.recordCount always returns -1 when there is data in the table. ANd If I try to call any methods/properties on recordset it crashes ...

Excel date to Unix timestamp

Does anyone know how to convert an Excel date to a correct Unix timestamp?

C# GemBox Excel Import Error

I am trying to import an excel file into a data table using GemBox and I keep getting this error: Invalid data value when extracting to DataTable at SourceRowIndex: 1, and SourceColumnIndex: 1. As ...

Importing from excel "applications" using SSIS

I am looking for any tips or resources on importing from excel into a SQL database, but specifically when the information is NOT in column and row format. I am currently doing some pre-development ...

热门标签