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 2012/03/28 23:31:42 UTC
DO NOT REPLY [Bug 52999] New: Performance issue with locking in
ContainerBase.fireContainerEvent()
https://issues.apache.org/bugzilla/show_bug.cgi?id=52999
Bug #: 52999
Summary: Performance issue with locking in
ContainerBase.fireContainerEvent()
Product: Tomcat 7
Version: 7.0.26
Platform: PC
OS/Version: Windows XP
Status: NEW
Severity: enhancement
Priority: P2
Component: Catalina
AssignedTo: dev@tomcat.apache.org
ReportedBy: knst.kolinko@gmail.com
Classification: Unclassified
This was reported on dev list [1]:
> 2) org.apache.catalina.core.ContainerBase.fireContainerEvent;
> That method contains critical section:
> synchronized (listeners) {
> list = listeners.toArray(list);
> }
>
> Is is called pretty often with every put operation into request or
> session map. That code in tomcat looks like a candidate for
> CopyOnWriteArrayList
>
I confirm that I see fireContainerEvent() calls in many places in
StandardSession.
Moreover those are two nested loops: a loop in StandardSession over array
of context.getApplicationEventListeners(); x copying the list of container
listeners inside into array in context.fireContainerEvent().
I cannot confirm reported problem with request attributes - I do not see
anything in the code that would send events from that access.
Is it possible to solve it with a ReadWriteLock?
Or it would be better to have a helper class that avoids copying the array over
on every access (the said copy-on-write one)?
I classify this as an enhancement request.
[1] Thread "Two performance problems (found during myfaces testing)" on dev
list, starting on 2012-03-08,
- http://tomcat.markmail.org/thread/7bbvzmkvyvryvn44
- http://marc.info/?t=133124021200002&r=1&w=2
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- 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 52999] Performance issue with locking in
ContainerBase.fireContainerEvent()
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52999
Mark Thomas <ma...@apache.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |FIXED
--- Comment #1 from Mark Thomas <ma...@apache.org> ---
The OP may have meant context attributes rather than request attributes.
I'm tempted to remove those container events for performance reasons.
I'm in favour of the ReadWriteLock since there is less copying and therefore
fewer objects and hence less GC.
Fixed in trunk and 7.0.x and will be included in 7.0.28 onwards.
--
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