• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Reading Spreadsheets with JExcelApi

 
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 79177
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Not a beginner's question. Moving.
 
Rudy Rodriguez
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic