Win a copy of Emmy in the Key of Code this week in the General Computing forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Paweł Baczyński
  • Piet Souris
  • Vijitha Kumara

Reading Spreadsheets with JExcelApi

 
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I am using JExcel to read Excel spreadsheets, in a Java application.

The program is opening a workbook, and reads the names of the sheets in the workbook.
I use a while loop to read through the sheets.

I created several workbooks with Identical sheet names.

My program is having problems reading a certain workbook. I get the following runtime error, when I try to read a certain workbook.
I am using Netbeans IDE, It seems that the sheet is large and is triggering a Out of Memory error.

How can I increase the memory in the Netbean editor to fix this.

Or is there another method to fix my problem.


Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java heap space
at jxl.read.biff.File.read(File.java:217)
at jxl.read.biff.Record.getData(Record.java:117)
at jxl.read.biff.CellValue.<init>(CellValue.java:94)
at jxl.read.biff.RKRecord.<init>(RKRecord.java:66)
at jxl.read.biff.SheetReader.read(SheetReader.java:419)
at jxl.read.biff.SheetImpl.readSheet(SheetImpl.java:716)
at jxl.read.biff.WorkbookParser.getSheet(WorkbookParser.java:252)


Thanks
Rudy
 
Rancher
Posts: 43011
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
NetBeans is an IDE; it shouldn't be used to run production code. What happens if you run it outside of NetBeans and increase the memory with the -Xmx switch?
 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In JXL you have got API methods to set the initial size and grow size.

public void setArrayGrowSize(int sz)
public void setInitialFileSize(int sz)


This would help you to tackle the out of memory issue, cause by default JXL tries to allocate 5 MB when invoked which could be an overhead in majority of the cases.

 
Marshal
Posts: 66158
250
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not a beginner's question. Moving.
 
Rudy Rodriguez
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All

I was able to correct the problem by increasing the size of my virtual memory in the IDE.

Thanks

Rudy
 
sunglasses are a type of coolness prosthetic. Check out the sunglasses on this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!