grails - OutOfMemoryError: Java heap space to upload 8 MB size file -
i using grails 2.4.4 , trying upload .xlsx file using 'apache poi' plugin getting java heap size exception when file size around 8 mb.
my controller has following action , methods:-
def uploadform() { string filename = "d:\\file.xlsx" map excelsheetmap = process(filename) } map process(string filename) { excelbuilder excelbuilder = new excelbuilder(filename) //getting java heap size exception here when trying create object //of excelbuilder file }
excelbuilder.groovy class file looks this
class excelbuilder { workbook workbook excelbuilder(string filename) { new file(filename).withinputstream { -> workbook = new xssfworkbook(is) } } }
i have tried using grails-excel-import plugin getting same exception.
can please suggest how import big size excel files in grails. in advance.
poi have high memory footprint. please see: http://poi.apache.org/spreadsheet/index.html
you can try sxssf. sxssf api-compatible streaming extension of xssf used when large spreadsheets have produced, , heap space limited.
Comments
Post a Comment