Quantcast
Channel: Adobe Community : Unanswered Discussions - ColdFusion
Viewing all articles
Browse latest Browse all 5794

apache poi and OutOfMemoryError

$
0
0

Hi All,

I am limited to CF standard 9.0.2 with Java Virtual Machine Path = 1024 and -XX:MaxPermSize=512m.

In the pass i was able to fix my memory issue with -XX:-UseGCOverheadLimit, not this time.

The error "java.lang.OutOfMemoryError: Java heap space" is when it is reading and excel macro file (.xlsm) with 2,500 KB already compact using this tech:

http://datapigtechnologies.com/blog/index.php/how-to-compress-xlsx-files-to-the-smallest-p ossible-size/

My code is:

<!--- new file to write -->

<cfset xlsFile = createObject("java","java.io.FileOutputStream").init(filepath) />

<!--- open stream and read in excel file template --->

<cfset xlsFileTemplate = createObject("java","java.io.FileInputStream").init(filepathtemplate)  />

<cfset newWorkbook = createObject("java","org.apache.poi.ss.usermodel.WorkbookFactory").create(xlsFileTemplate ) /> <!--- Error line --->

<!--- read from template to new FileOutput --->

<cfset writeableWorkbook = createObject("java","org.apache.poi.xssf.streaming.SXSSFWorkbook").init(newWorkbook,100) />

<cfset cellStyleStatic = createObject("java","org.apache.poi.xssf.usermodel.XSSFCellStyle") />

 

Anyone knows a better way to open xlsm file in apache poi?

Any other ideas?

Thanks in advanced.

 

Using new poi 3.11 beta 3.


Viewing all articles
Browse latest Browse all 5794

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>