java.lang.OutOfMemoryError: Java heap space
Copy link to clipboard
Copied
Hello All,
I was trying to read an excel file in Coldfusion using the below code , but I got the following error.
Code :
<cfspreadsheet action="read" src="TestData.xlsx" sheet="1" rows="2-3" query="excelData">
Error :
Java heap space The specific sequence of files included or processed is: /mnt/cfcontent/icfinstance/cet/ceg_v2/readExcel.cfm, line: 5 "
java.lang.OutOfMemoryError: Java heap space.
Any one have any idea about this. Your help is well appreciated.
Thanks in advance
Copy link to clipboard
Copied
Is it a formatted xlsx? Can you test with xls?
Thanks
VJ
Copy link to clipboard
Copied
Sounds like you tried to read a multi-GB file completely into memory.
Adam Cameron recently posted a similar instance and shows how reading the data in bits might be a better solution:
http://cfmlblog.adamcameron.me/2013/12/file-looping-strategies-it-doesnt-seem.html

