2014-05-02 17:29 GMT+04:00 Scott Severtson <ssevert...@digitalmeasures.com>:
> All,
>
> We've developed a patch as proposed below, and have been running it in our
> production environment (currently Tomcat 6.0.37) for several months. The
> patch applies cleanly to the Tomcat 6.0.x, 7.0.x, and 8.0.x series, with
> very minor variation in the exact line numbers.
>
> The patch introduces the following System properties:
> * org.apache.jasper.runtime.BodyContentImpl.TAG_BUFFER_SIZE
>   Allows overriding the initial tag buffer size; useful for applications
> that make heavy use of tags, and very often exceed the default 512 bytes
> defined in org.apache.jasper.Constants.DEFAULT_TAG_BUFFER_SIZE, eliminating
> the need for reallocation of the buffer. Defaults to
> Constants.DEFAULT_TAG_BUFFER_SIZE for backwards compatibility.
> * org.apache.jasper.runtime.BodyContentImpl.MAX_TAG_BUFFER_SIZE
>   Introduces the maximum buffer size that should be reused by future tags;
> if a buffer exceeds this limit, *and*
> org.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER is set to true, the
> buffer will be discarded, and a new buffer of size
> org.apache.jasper.runtime.BodyContentImpl.TAG_BUFFER_SIZE will be created.
> Defaults to current value of
> org.apache.jasper.runtime.BodyContentImpl.TAG_BUFFER_SIZE, again for
> backwards compatibility.
>
> No changes will occur for users with the default configuration, or for users
> with org.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER set to true.
> This patch only adds new, optional functionality.
>
> In our production environment, we've been running with the following
> settings:
> * LIMIT_BUFFER=true
> * TAG_BUFFER_SIZE=16384
> * MAX_TAG_BUFFER_SIZE=65536
>
> Our metrics show that for our application, we're experiencing significantly
> less garbage collection of tag buffers (versus old behavior with
> LIMIT_BUFFERS=true), while maintaining a more consistent memory profile
> (versus old behavior with LIMIT_BUFFERS=false). With LIMIT_BUFFERS=false, we
> previously found that requests for very large pages rendered within a tag
> could cause memory usage to balloon, eventually leading to an OOME.
>
> Please let me know if there's anything I can/should do to ensure this patch
> is applied to the 6, 7, and 8 releases.
>
> Thanks!
> Scott Severtson
> Lead Platform Architect
> Digital Measures
>
> (...)


1. The patches have to be submitted via Bugzilla.

1) The mail-server strips attachments. Your did come through though.
2) Issues not filed in bugzilla tend to be forgotten in all the mail stream.
3) It is better to reference an issue # in changelog.

2. A quick formal review of the patch itself:

1) You are changing system-wide defaults for all web applications.
Thus I think a better place for your changes is the Constants class.
There are already some system properties that change values of
constants there.

2) Documentation update is needed.
(webapps/docs/config/systemprops.xml)


Best regards,
Konstantin Kolinko

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

Reply via email to