https://issues.apache.org/bugzilla/show_bug.cgi?id=43925

--- Comment #13 from Brian Remmington 
<brian.remming...@celestialservices.co.uk> ---
Hi Issa

It's been a while since I raised this (6 years), so I had to refresh my memory.

I've just checked out the trunk of Tomcat 8, and the same problem exists, and I
still think my code addresses it.

Your final sentence describes exactly what my suggested solution does: it
improves the way the buffer grows to reduce array copies and reduce garbage
collection. Your other comments don't relate to my proposal.

In the current Tomcat class (org.apache.jasper.runtime.BodyContentImpl), the
problem is with the method reAllocBuff(int) which is right at the bottom of the
class. This is called when the buffer array (cb) needs to grow, and it's
terribly inefficient.

My code replaces cb with an instance (named "buffer") of a new class CharBuffer
which manages a LinkedList of char arrays to ensure that, upon growth
(CharBuffer.grow), no array copy occurs, and nothing is left to the garbage
collector.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to