Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / March 2008

Tip: Looking for answers? Try searching our database.

jxl / java heap space error

Thread view: 
ChrisW - 27 Mar 2008 11:06 GMT
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[i]);        //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
Roedy Green - 29 Mar 2008 00:23 GMT
>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.
Signature


Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.