cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Torsten Curdt <tcu...@apache.org>
Subject Re: Javaflow - major memory issue
Date Fri, 28 Mar 2008 08:55:24 GMT

On Mar 28, 2008, at 04:29, Joerg Heinicke wrote:
> On 27.03.2008 10:33, Torsten Curdt wrote:
>
>>>>> Just have a look at the quote from the original. It gives the  
>>>>> object
>>>>> relationships in the memory. BufferedOutputStream takes 50% and is
>>>>> hold in HttpEnvironment which is hold in TreeProcessorRedirector
>>>>> which is hold in ContinuationContext. I wondered why it is there.
>>>>
>>>> Ah ...well, the ContinuationContext should be short living. Maybe
>>>> there is a dangling reference to it?
>>>
>>> Ah, getting closer :)
>>>
>>> It's the Continuation that holds the ContinuationContext [1]:
>> Hm... it should set clear the reference in 'finally'. See the  
>> execute method
>> http://svn.apache.org/viewvc/commons/sandbox/javaflow/trunk/src/java/org/apache/commons/javaflow/bytecode/StackRecorder.java?revision=560660&view=markup
>
> The output I showed pointed to  
> org.apache.cocoon.components.flow.java.Continuation which only seems  
> to exist in Cocoon 2.1. Nothing unsets the context there.

Hah - well spotted!

> Having a look into the code continuations are only handled by  
> JavaInterpreter. There are two methods callFunction(..) and  
> handleContinuation(..) calling Continuation.registerThread() and  
> deregisterThread() in a finally block. From a brief look I have no  
> idea if I can just unset the ContinuationContext there as well. You  
> might know more about it.

We should add a try/finally block in Continuation.suspend() that  
clears the context after a suspend. That should fix it.

cheers
--
Torsten

Mime
View raw message