jxl / java heap space error

C

ChrisW

HI,

I've got a spreadsheet I'm trying to read in using the jxl api. My
spreadsheet is about 12 Mb (~200 columns x 6000 rows). My code can
read the spreadsheet, and can print a list of the worksheets using the
following:

rawData = Workbook.getWorkbook(dataFile, wks);
String [] sheetNames = rawData.getSheetNames();

for(int i = 0; i<numberOfSheets; i++)
{
tools.out(sheetNames); //print the sheet names
}

I then try to access the sheet I want

rawDataSheet = rawData.getSheet("Sheet1");

NVars = rawDataSheet.getColumns();
NRows = rawDataSheet.getRows();

System.out.println(NVars + " " + NRows);

I never get to the final print statemement. I've set the
WorkbookSettings as follows:

WorkbookSettings wks = new WorkbookSettings();
wks.setInitialFileSize(30000000);
wks.setArrayGrowSize(6000000);

and I've edited my -Xms and -Xmx to the following:

-Xms4m -Xmx30m

I (and my colleagues) have got no idea what to do next! If anyone can
help, then they might stop my computer from being thrown out of the
window ;)

Thanks,
Chris
 
R

Roedy Green

I never get to the final print statemement. I've set the
WorkbookSettings as follows:

You are not getting an error message, right?

You can either pepper the code with debug statements to figure out
precisely where it is looping/hanging, or you can use the debugger in
your IDE to start tracing and seeing that it is doing.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top