Link to home
Start Free TrialLog in
Avatar of Panos
PanosFlag for Germany

asked on

cOLDFUSION -jRUN4 "java.lang.OutOfMemoryError: GC overhead limit exceeded" ERROR

Hello experts.
I have a probem using the poiutility (http://www.bennadel.com/projects/poi-utility.htm) when i'm trying to import one excel file with 65000 rows and 48 columns in a mysql table.
I get OutOfMemoryError errors like:
java.lang.OutOfMemoryError: GC overhead limit exceeded

How can i solve this?Is there any way without changing anything on the server?

<CFSET ServerFile = CFFILE.SERVERFILE>
           <cfoutput>
    <!--- Create an instance of the POIUtility.cfc. --->
	      <cfset objPOI = CreateObject( 
		   "component", 
		   "POIUtility" 
		    ).Init() 
		    />
	      <cfset objSheet = objPOI.ReadExcel( 
		   FilePath = ExpandPath( "./temp/#ServerFile#"),
		   HasHeaderRow = true,
		   SheetIndex = 0
		   ) />
         </cfoutput>
	   <cfloop query="objSheet.Query">
        <cfquery name="addRow" datasource="#request.dsn#">
                   INSERT INTO HSNTSN (firstcolumn,secondcolumn,...........,48column)
                   VALUES  (
                   <cfloop index="i" from="1" to="48">
                     <cfif len(Evaluate('objSheet.Query.column#i#'))>
                       <cfif i EQ 6 OR i EQ 20 OR i EQ 44 >
                        <cfqueryparam value="#Evaluate('objSheet.Query.column#i#')#" cfsqltype="cf_sql_timestamp">
                       <cfelse>
                        <cfqueryparam value="#Evaluate('objSheet.Query.column#i#')#" cfsqltype="cf_sql_varchar">
                       </cfif>
                     <cfelse>NULL</cfif><cfif i NEQ 48>,</cfif>
                   </cfloop>
                  
                   )
        </cfquery>
      </cfloop>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of _agx_
_agx_
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Panos

ASKER

Hi agx.
You are right.without the second loop (inside the query) it is working much better.
But i will try to use the LOAD DATA INFILE way.
Thank you
(happy new year)
Avatar of Panos

ASKER

Thank you
regards
panos
Happy new year to you too :)