[Prev] Thread [Next]  |  [Prev] Date [Next]

Re: flush of outputstream Magne Skjeret Tue Mar 30 09:46:33 2004

Geir Magnusson Jr wrote:

On Mar 29, 2004, at 4:47 AM, Magne Skjeret wrote:


I have a question I cant seem to find the answer to on the net.

I have had some problems with my application running out of memory. Now I have traced the problem to my gzip filter, which stored every bytes in memory before flushing it. I have no implemented it so that the filer sends the bytes chunkeced, when the bytes are written to the output stream. That seems to work fine, but to be 100% sure that I have dealt with the problem I need to know if velocity flush its output to the response, when it is finsihed with a part.
Or does it wait untill the entire template is finished?

Velocity doesn't ever flush - it leaves that up to the containing application (i.e. a servlet, the servlet container, your app...)

Well, I understand that, but still velocity could e.g buffer everything in a StringBuffer, and when the template is finshed parsing everything is written to the outputstream in one chunck. Or do it write directly to the output stream as parts of the template is finished.

Maybe I am way of here. I havent studied the velocity internals, maybe I should.

A equivalient would be to look at a jsp.
This is then written to the response stream in chunck and it is up to the container when to flush, but at least it is given to the container to deal with it.

Would not be printed untill both strings are written to the stream.

So maybe if I reprashe my question. Does velocity give the content to the container when everything is done, or as parts is finished?


Is there anyone that can shed some light on that?


To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]