You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Samuel Tribehou <s....@cykia.com> on 2004/08/20 18:27:35 UTC

flowscript and infinite loops

Hello, 

I know this is a silly question, but..
I'd like to know what happens exactly in memory with this type of flow : 

flowscript_func ()
{
     while (true)
    {
       cocoon.sendPageAndWait("/example");

      // do things with user input
    }
}

Of course the purpose is  to load the page, have the user 
enter data and do things with it, then reload the updated page, etc...

But what happens when the user clicks a link which leads him to another form
(and another flowscript loop) ? Will the previous loop continue to wait  for 
sendPageAndWait() to return and leak some memory ?



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: flowscript and infinite loops

Posted by Samuel Tribehou <s....@cykia.com>.
Ok thanks for the responses, i indeed have a memory leak 
but it's probably my own code. I had an application made 
entirely of forms to do, and i think i misused cocoon... 
(cforms couldn't do it so i ended up with various xsl layers 
to "feed" the forms, from the db and from xml, but as the client 
refined his requests and wanted more and more specific things 
for each form, i ended up with a huge bloat... )

----- Original Message ----- 
From: "Tony Collen" <co...@umn.edu>
To: <us...@cocoon.apache.org>
Sent: Friday, August 20, 2004 9:21 PM
Subject: Re: flowscript and infinite loops


> Arthur van Dorp wrote:
> 
> >> Remember, the execution is halted at sendPageAndWait(), so nothing is 
> >> really "running" at that point.  Only when <map:call continuation=""/> 
> >>  is called, will the execution resume.
> >>
> >> If the user clicks on a different link and "loses" the continuation 
> >> ID, the continuation will still be around (i.e. it can be restarted), 
> >> until it expires and is cleaned up after a while by the 
> >> ContinuationsManager.
> >>
> >> If you managed to keep track of the continuation IDs, the user could 
> >> even switch back and forth between the loops.
> > 
> > 
> > I think the question is more about memory consumption. Isn't it?
> > 
> 
> Yeah, I guess I forgot to mention that part. I would guess the 
> ContinuationsManager would clean it up and there would be no memory leak.
> 
> Tony





---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: flowscript and infinite loops

Posted by Tony Collen <co...@umn.edu>.
Arthur van Dorp wrote:

>> Remember, the execution is halted at sendPageAndWait(), so nothing is 
>> really "running" at that point.  Only when <map:call continuation=""/> 
>>  is called, will the execution resume.
>>
>> If the user clicks on a different link and "loses" the continuation 
>> ID, the continuation will still be around (i.e. it can be restarted), 
>> until it expires and is cleaned up after a while by the 
>> ContinuationsManager.
>>
>> If you managed to keep track of the continuation IDs, the user could 
>> even switch back and forth between the loops.
> 
> 
> I think the question is more about memory consumption. Isn't it?
> 

Yeah, I guess I forgot to mention that part. I would guess the 
ContinuationsManager would clean it up and there would be no memory leak.

Tony

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: flowscript and infinite loops

Posted by Arthur van Dorp <ar...@gmx.net>.
> Remember, the execution is halted at sendPageAndWait(), so nothing is 
> really "running" at that point.  Only when <map:call continuation=""/> 
>  is called, will the execution resume.
> 
> If the user clicks on a different link and "loses" the continuation ID, 
> the continuation will still be around (i.e. it can be restarted), until 
> it expires and is cleaned up after a while by the ContinuationsManager.
> 
> If you managed to keep track of the continuation IDs, the user could 
> even switch back and forth between the loops.

I think the question is more about memory consumption. Isn't it?

Arthur


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: flowscript and infinite loops

Posted by Tony Collen <co...@umn.edu>.
Samuel Tribehou wrote:

> Hello, 
> 
> I know this is a silly question, but..
> I'd like to know what happens exactly in memory with this type of flow : 
> 
> flowscript_func ()
> {
>      while (true)
>     {
>        cocoon.sendPageAndWait("/example");
> 
>       // do things with user input
>     }
> }
> 
> Of course the purpose is  to load the page, have the user 
> enter data and do things with it, then reload the updated page, etc...
> 
> But what happens when the user clicks a link which leads him to another form
> (and another flowscript loop) ? Will the previous loop continue to wait  for 
> sendPageAndWait() to return and leak some memory ?

Remember, the execution is halted at sendPageAndWait(), so nothing is 
really "running" at that point.  Only when <map:call continuation=""/> 
  is called, will the execution resume.

If the user clicks on a different link and "loses" the continuation 
ID, the continuation will still be around (i.e. it can be restarted), 
until it expires and is cleaned up after a while by the 
ContinuationsManager.

If you managed to keep track of the continuation IDs, the user could 
even switch back and forth between the loops.

Regards,

Tony

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org