I am using JXL to write an excel file of 50000 rows and 30 columns. My code looks like this:
for (int j = 0; j < countOfRows; j++) {
myWritableShe
Is raising the memory available to the VM (with -Xms and -Xmx) not an option?
The JExcel FAQ has a couple of suggestions including Curtis' idea above.
If you don't mind the performance hit, you could use a temporary file instead of doing it all in memory.
WorkbookSettings s = new WorkbookSettings();
s.setUseTemporaryFileDuringWrite(true);
WritableWorkbook ws = Workbook.createWorkbook(new File("someFile.xls"),s);