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 ( 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?

    <!--- Create an instance of the POIUtility.cfc. --->
	      <cfset objPOI = CreateObject( 
	      <cfset objSheet = objPOI.ReadExcel( 
		   FilePath = ExpandPath( "./temp/#ServerFile#"),
		   HasHeaderRow = true,
		   SheetIndex = 0
		   ) />
	   <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">
                        <cfqueryparam value="#Evaluate('objSheet.Query.column#i#')#" cfsqltype="cf_sql_varchar">
                     <cfelse>NULL</cfif><cfif i NEQ 48>,</cfif>

Open in new window

Avatar of _agx_
Flag of United States of America image

Link to home
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


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


Thank you
Happy new year to you too :)