0

There is a desktop application that uses apache.poi to interate a 50,000 line XLSX file and following validation write it to a database for reporting purposes.

The application is finalized as all required functionality works. Developed on a box under OpenSuse 43.3, KDE, 4 x i5-2500CPUs, 16gig RAM. Packaging it out to a jar file sees it run without issue on laptop under same linux and Win 10. However, running it on the development box under Win 10 causes the following error when running the validation method on the file.

Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java heap space
        at org.apache.xmlbeans.impl.store.Cur$CurLoadContext.attr(Cur.java:3044)
        at org.apache.xmlbeans.impl.store.Locale.loadNode(Locale.java:1440)
        at org.apache.xmlbeans.impl.store.Locale.loadNodeChildren(Locale.java:1403)
        at org.apache.xmlbeans.impl.store.Locale.loadNode(Locale.java:1445)
        at org.apache.xmlbeans.impl.store.Locale.loadNodeChildren(Locale.java:1403)
        at org.apache.xmlbeans.impl.store.Locale.loadNode(Locale.java:1445)
        at org.apache.xmlbeans.impl.store.Locale.loadNodeChildren(Locale.java:1403)
        at org.apache.xmlbeans.impl.store.Locale.loadNode(Locale.java:1445)
        at org.apache.xmlbeans.impl.store.Locale.parseToXmlObject(Locale.java:1385)
        at org.apache.xmlbeans.impl.store.Locale.parseToXmlObject(Locale.java:1370)
        at org.apache.xmlbeans.impl.schema.SchemaTypeLoaderBase.parse(SchemaTypeLoaderBase.java:370)
        at org.apache.poi.POIXMLTypeLoader.parse(POIXMLTypeLoader.java:164)
        at org.openxmlformats.schemas.spreadsheetml.x2006.main.WorksheetDocument$Factory.parse(Unknown Source)
        at org.apache.poi.xssf.usermodel.XSSFSheet.read(XSSFSheet.java:226)
        at org.apache.poi.xssf.usermodel.XSSFSheet.onDocumentRead(XSSFSheet.java:218)
        at org.apache.poi.xssf.usermodel.XSSFWorkbook.parseSheet(XSSFWorkbook.java:443)
        at org.apache.poi.xssf.usermodel.XSSFWorkbook.onDocumentRead(XSSFWorkbook.java:408)
        at org.apache.poi.POIXMLDocument.load(POIXMLDocument.java:169)
        at org.apache.poi.xssf.usermodel.XSSFWorkbook.<init>(XSSFWorkbook.java:300)
        at com.zimpics.eds.app_wa01a.VDate.readFile(VDate.java:97)
        at com.zimpics.eds.app_wa01a.VDate.validate(VDate.java:122)
        at com.zimpics.eds.app_wa01a.GUI.Application.validateFile(Application.java:507)
        at com.zimpics.eds.app_wa01a.GUI.Application.access$600(Application.java:43)
        at com.zimpics.eds.app_wa01a.GUI.Application$5.actionPerformed(Application.java:425)
        at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
        at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
        at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
        at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
        at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
        at java.awt.Component.processMouseEvent(Unknown Source)
        at javax.swing.JComponent.processMouseEvent(Unknown Source)
        at java.awt.Component.processEvent(Unknown Source)

I have no idea how to address this issue. Can somebody point me in the right direction please?

trincot
  • 317,000
  • 35
  • 244
  • 286
Geoff
  • 683
  • 3
  • 9
  • 16
  • 3
    Have you tried increasing the heap size with the `-Xmx` option? – Henry Nov 23 '18 at 05:40
  • If you have an active application you can run `WMIC path win32_process get Caption,Processid,Commandline` in `cmd` to dump out all active processes and their program arguments. Should be able to see what the `Xmx` memory size is then – flakes Nov 23 '18 at 05:50
  • Are you running it with 64 bit version of Java? What is `java -version` output? – talex Nov 23 '18 at 05:51
  • @talex .. indeed! The Win10 box in question has 32bit Java installed. – Geoff Nov 24 '18 at 22:15
  • and @Henry, increasing the size of the heap does not solve the issue .. had to install 64bit Java. ... – Geoff Nov 24 '18 at 22:15
  • @flakes .. didn't get to your suggestion, but thanks :) – Geoff Nov 24 '18 at 22:15

0 Answers0