heap - CFINVOKE vs java.lang.OutOfMemoryError in ColdFusion -


I'm having problems with ColdFusion piles. Here is a small example application I'm using. I thought that after calling cfinvoke , the init method destroys all the variables for this component but apparently this is not the case. This application works as below, but if I add loop to index.cfm , then it breaks. What is the reason that what is stored in the heap? Is there no way around this?

index.cfm:

  & lt; Cfloop = "1" from = "1000" index = "I" & gt; & Lt; Cfinvoke component = "test" method = "init" returnvariable = "x" & gt; & Lt; / Cfloop & gt; & Lt; Cfoutput & gt; & Lt; P & gt; # X # & lt; / P & gt; & Lt; / Cfoutput & gt;  

test.cfc:

  & lt; Cfcomponent output = "wrong" & gt; & Lt; Cffunction name = "init" returntype = "string" & gt; & Lt; Cfset var test = structNew () & gt; & Lt; Cfloop = "1" to = "1000" index = "i" & gt; & Lt; Cfset test [i] = i & gt; & Lt; / Cfloop & gt; & Lt; Cfreturn now ()> & Lt; / Cffunction & gt; & Lt; / Cfcomponent & gt;  

And here is the error message:

  Surrender: Servlet.service for servlet () CfmServlet exempted by javax.servlet threw away. ServletException: Root Causes: java.lang.OutOfMemoryError: Java Hip Space ` 

Any help would be appreciated.

This is a known problem and currently there is no way around it. It seems that the CF does not control garbage collection properly. As far as I can tell that until this request ends, the component used by the component will not destroy and will not free.

Because of this, depending on how many qualities your components are, how many of them are you can not get a heap error.

I know that this does not help in your problem, but at least now you can take measures to stop it.


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -