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 2019/04/18 09:00:47 UTC
[Bug 63361] New: Provide a configuration option to disable MBean
registration
https://bz.apache.org/bugzilla/show_bug.cgi?id=63361
Bug ID: 63361
Summary: Provide a configuration option to disable MBean
registration
Product: Tomcat 9
Version: 9.0.x
Hardware: PC
OS: Mac OS X 10.1
Status: NEW
Severity: enhancement
Priority: P2
Component: Util
Assignee: dev@tomcat.apache.org
Reporter: awilkinson@pivotal.io
Target Milestone: -----
We use Tomcat as the default embedded Servlet container in Spring Boot. Some of
our users make use of Tomcat's MBeans but, from what we've seen, the majority
of them do not. That's led us to look at the cost of having the MBeans
registered by default to see if we can reduce it for users who do not use them.
One cost is in increased startup time. We've mitigated this by creating an
MBeanFactory instance in a separate thread. This causes the MBean XML to be
loaded in parallel to the rest of startup which significantly reduces the
noticeable effect of the unwanted processing.
The other cost is in increased memory usage. We've tried to find a way to
reduce this but have been unable to do so without resorting to reflection. In
the reflection-based approach we replace the Registry instance held by
org.apache.tomcat.util.modeler.Registry with a custom sub-class that no-ops all
of its methods. This hack sees a ~2MB reduction in heap usage. An app that
previously required -Xmx9M to start is able to start with -Xmx7M.
We'd greatly appreciate a configuration option in Tomcat that allowed MBean
registration to be disabled programatically without resorting to reflective
hacks. If the Tomcat community agree that this is a worthwhile enhancement, I
would be happy to contribute something once an approach has been agreed upon.
--
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 63361] Provide a configuration option to disable MBean
registration
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=63361
--- Comment #4 from Remy Maucherat <re...@apache.org> ---
I have verified it seems to work for me without problems. I didn't expect it
would be so simple.
--
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 63361] Provide a configuration option to disable MBean
registration
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=63361
--- Comment #2 from Remy Maucherat <re...@apache.org> ---
Personally, I am (still) not convinced by creative hacks such as a parallel
loading contraption or any delayed loading, so it would have to be the
pluggable or configurable way.
--
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 63361] Provide a configuration option to disable MBean
registration
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=63361
--- Comment #1 from Andy Wilkinson <aw...@pivotal.io> ---
Here [1] is the Spring Boot issue tracking our investigation of disabling MBean
registration and the benefits of doing so.
[1] https://github.com/spring-projects/spring-boot/issues/16498
--
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 63361] Provide a configuration option to disable MBean
registration
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=63361
Mark Thomas <ma...@apache.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |FIXED
Status|NEW |RESOLVED
--- Comment #3 from Mark Thomas <ma...@apache.org> ---
Fixed in:
- master for 9.0.20 onwards
Call Registry.disableRegistry() before the first Tomcat MBean is registered.
--
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