excel - Java.lang.OutOfMemoryError:Java heap space org.apache.poi.ss.formula.FormulaCellCacheEntrySet.add(FormulaCellCacheEntrySet.java:63) -


i using "switch(evaluator.evaluateincell(cellin).getcelltype())" in java program evaluate formula in excel. have arount 15,000 rows in excel. here code:

cell celldb_acctnumber = row1.createcell(lastcell1);             celldb_acctnumber.setcelltype(cell.cell_type_formula);             celldb_acctnumber.setcellformula("vlookup($e"+k+",'sql_ams_data'!$c$2:$f$"+lastrowdb+",2,false)");              cell celldb_routnumber = (hssfcell) row1.createcell(lastcell1+1);             celldb_routnumber.setcelltype(xssfcell.cell_type_formula);             celldb_routnumber.setcellformula("vlookup($e"+k+",'sql_ams_data'!$c$2:$f$"+lastrowdb+",3,false)");              cell celldb_accttype = (hssfcell) row1.createcell(lastcell1+2);             celldb_accttype.setcelltype(xssfcell.cell_type_formula);             celldb_accttype.setcellformula("vlookup($e"+k+",'sql_ams_data'!$c$2:$f$"+lastrowdb+",4,false)"); 

when run in eclipse got below error. please me out of error ?

exception in thread "main" java.lang.outofmemoryerror: java heap space     @ org.apache.poi.ss.formula.formulacellcacheentryset.add(formulacellcacheentryset.java:63)     @ org.apache.poi.ss.formula.cellcacheentry.addconsumingcell(cellcacheentry.java:85)     @ org.apache.poi.ss.formula.formulacellcacheentry.changeconsumingcells(formulacellcacheentry.java:80)     @ org.apache.poi.ss.formula.formulacellcacheentry.setsensitiveinputcells(formulacellcacheentry.java:60)     @ org.apache.poi.ss.formula.formulacellcacheentry.updateformularesult(formulacellcacheentry.java:109)     @ org.apache.poi.ss.formula.cellevaluationframe.updateformularesult(cellevaluationframe.java:75)     @ org.apache.poi.ss.formula.evaluationtracker.updatecacheresult(evaluationtracker.java:93)     @ org.apache.poi.ss.formula.workbookevaluator.evaluateany(workbookevaluator.java:294)     @ org.apache.poi.ss.formula.workbookevaluator.evaluate(workbookevaluator.java:229)     @ org.apache.poi.hssf.usermodel.hssfformulaevaluator.evaluateformulacellvalue(hssfformulaevaluator.java:354)     @ org.apache.poi.hssf.usermodel.hssfformulaevaluator.evaluateincell(hssfformulaevaluator.java:243)     @ org.apache.poi.hssf.usermodel.hssfformulaevaluator.evaluateincell(hssfformulaevaluator.java:46)     @ com.sentry.comparison.convert.xls2xlsx.xls2xlsxconvert(xls2xlsx.java:74)     @ com.sentry.comparison.main.comparisonmain.main(comparisonmain.java:41) 

you can increase heap memory on eclipse.ini file, adding lines in bottom of file:

-xx:permsize=256m -xx:maxpermsize=512m

but if running web application web container or web server, increase memory of server.

if running tomcat, create sh ou bat file (depending of o.s.), put file inside bin directory , write instructions inside file:

set catalina_opts=-server -xms256m -xmx2048m -xx:permsize=512m -xx:maxpermsize=512


Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -