|
What does your webservice/component do? Since you’re calling it over and over again in the loop, are the values it’s returning things that you could cache, or stick into a lookup table, or some otherwise rewrite of the insides to that method)? Maybe that would speed things up as well.
I assume you’ve profiled the page somehow, and are certain you’re looking at the “problem code area”, yes?
Just something else to check…
hth
Nolan Erck -----Original Message-----
Yes, that is how it was before trying to see if triggering the GC or wiping and recreating the object would help server resources. The page runs the same either way, just have not had to get back into it to change it back to creating the object outside the loop and removing the GC calls and the objSomething = "";
The thing that seems to save the server from crashing is mainly the objSomething = CreateObject("webservice", "url.to.some.cfc; instead of objSomething =
CreateObject("component", "a.dot.naming.some.cfc");
Best I can tell resources just are not released until the page has been fully
loaded and ran, which is why I guess calling the web service makes it work most
of the time since then you are calling a separate page as far as the server is
concerned. On 3/9/06, Mihai Manuta <[EMAIL PROTECTED]> wrote: Instead of: for(i=0;i lte 100000;i=i+1) { it is generally better to write: objSomething =
createObject("whatever","a.dot.naming.SomeClass"); In this way you will reuse the same object inside the
loop, with many benefits to both memory and cpu. Mihai
What if you had an CFC instance that was doing a lot of data manipulation within a loop? I have noticed in some pages here that do just that, that the CF Service just keeps grabbing and grabbing resources from the server until the entire page has completed running or until the server runs out of resources. It seems like it should be able to be forced to release the resources via triggering the GC manually although that is not what I have observed. I do something like this to trigger the GC:
----------------------------------------------------------
The information contained in this e-mail is confidential and may contain privileged information exempt from disclosure under applicable law. The information is intended only for the use of the individual or entity to which it is addressed. If you are not the intended recipient, employee, or agent responsible to deliver it to the intended recipient, you are hereby notified that any use, dissemination, distribution, or copying of this communication is strictly prohibited. If you have received this e-mail in error, please delete the message from your computer and immediately notify the sender by telephone (you may call collect) at 916-569-5400 or by e-mail to [EMAIL PROTECTED] Thank you.
---------------------------------------------------------- |
- RE: [CFCDev] how to destroy object in cfc: Questions Nolan Erck
