You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2024/10/15 14:48:02 UTC
[Bug 69398] New: Excess object allocation in PageContextImpl
https://bz.apache.org/bugzilla/show_bug.cgi?id=69398
Bug ID: 69398
Summary: Excess object allocation in PageContextImpl
Product: Tomcat 9
Version: 9.0.x
Hardware: PC
Status: NEW
Severity: normal
Priority: P2
Component: Jasper
Assignee: dev@tomcat.apache.org
Reporter: jengebr@amazon.com
Target Milestone: -----
The constructor org.apache.jasper.runtime.PageContextImpl includes this line:
this.outs = new BodyContentImpl[0];
Heap analysis of our large, JSP-heavy app shows large numbers of
BodyContentImpl[], with sizes ranked in order of frequency:
[0]
[1]
[2]
[3]
[4]
There are two ways to address this:
1. Define "private static final EMPTY_ARRAY = new BodyContentImpl[0]" and
assign this value in the constructor
2. Change the allocation to BodyContentImpl[1] or [2], thus eliminating [0] and
copies
My testing shows that change #1 eliminates the [0] arrays and saves < 5% of
clock time; this is definitely about heap pollution rather than direct runtime.
Option #2 is harder to predict since it potentially adds overhead when the [0]
is sufficient.
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
[Bug 69398] Excess object allocation in PageContextImpl
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=69398
Mark Thomas <ma...@apache.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |FIXED
Status|NEW |RESOLVED
OS| |All
--- Comment #1 from Mark Thomas <ma...@apache.org> ---
Fixed in:
- 11.0.x for 11.0.1 onwards
- 10.1.x for 10.1.32 onwards
- 9.0.x for 9.0.97 onwards
Thanks for the suggestion.
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org