Bug 15178 - OutOfMemoryError
Summary: OutOfMemoryError
Status: RESOLVED INVALID
Alias: None
Product: POI
Classification: Unclassified
Component: HSSF (show other bugs)
Version: 1.5.1
Hardware: PC other
: P3 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-12-09 15:04 UTC by Holger Schulz
Modified: 2004-11-16 19:05 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Holger Schulz 2002-12-09 15:04:16 UTC
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);
    }
Comment 1 Avik Sengupta 2002-12-12 08:47:23 UTC
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.