Details
Description
When shutting down Tomcat 7.0.42, catalina.out displays the following warning indicating a memory leak:
Jul 28, 2013 9:55:59 AM org.apache.coyote.AbstractProtocol start INFO: Starting ProtocolHandler ["http-bio-8080"] Jul 28, 2013 9:55:59 AM org.apache.coyote.AbstractProtocol start INFO: Starting ProtocolHandler ["ajp-bio-8009"] Jul 28, 2013 9:55:59 AM org.apache.catalina.startup.Catalina start INFO: Server startup in 841 ms Jul 28, 2013 9:56:09 AM org.apache.catalina.core.StandardServer await INFO: A valid shutdown command was received via the shutdown port. Stopping the Server instance. Jul 28, 2013 9:56:09 AM org.apache.coyote.AbstractProtocol pause INFO: Pausing ProtocolHandler ["http-bio-8080"] Jul 28, 2013 9:56:09 AM org.apache.coyote.AbstractProtocol pause INFO: Pausing ProtocolHandler ["ajp-bio-8009"] Jul 28, 2013 9:56:09 AM org.apache.catalina.core.StandardService stopInternal INFO: Stopping service Catalina Jul 28, 2013 9:56:09 AM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks SEVERE: The web application [/asynclog] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@648bfdea]) and a value of type [org.apache.logging.log4j.core.async.AsyncLogger.Info] (value [org.apache.logging.log4j.core.async.AsyncLogger$Info@4e26d560]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak. Jul 28, 2013 9:56:09 AM org.apache.coyote.AbstractProtocol stop INFO: Stopping ProtocolHandler ["http-bio-8080"] Jul 28, 2013 9:56:09 AM org.apache.coyote.AbstractProtocol stop INFO: Stopping ProtocolHandler ["ajp-bio-8009"] Jul 28, 2013 9:56:09 AM org.apache.coyote.AbstractProtocol destroy INFO: Destroying ProtocolHandler ["http-bio-8080"] Jul 28, 2013 9:56:09 AM org.apache.coyote.AbstractProtocol destroy INFO: Destroying ProtocolHandler ["ajp-bio-8009"]
<?xml version="1.0" encoding="UTF-8"?> <configuration status="WARN"> <appenders> <FastRollingFile name="MyFileLog" filename="logs/my.log" filePattern="logs/my-%d{COMPACT}.log"> <PatternLayout pattern="%d %p %c{1.} [%t] %m%n" /> <Policies> <SizeBasedTriggeringPolicy size="5MB" /> </Policies> </FastRollingFile> <Console name="Console" target="SYSTEM_OUT"> <PatternLayout pattern="%d %p %c{1.} [%t] %m%n" /> </Console> </appenders> <loggers> <logger name="mylogger" level="INFO" additivity="false"> <appender-ref ref="MyFileLog" /> </logger> <root level="TRACE"> <appender-ref ref="Console" /> </root> </loggers> </configuration>
#!/bin/bash CATALINA_OPTS=-DLog4jContextSelector=org.apache.logging.log4j.core.async.AsyncLoggerContextSelector
Attachments
Issue Links
- incorporates
-
LOG4J2-1172 ThreadLocal leak [AsyncLogger$Info] on Tomcat when using AsyncLoggerContextSelector
- Resolved
- is duplicated by
-
LOG4J2-425 Permgen leak in AsyncLoggerConfigHelper
- Resolved
- is part of
-
LOG4J2-493 Problem with AsyncLogger when web app is deployed/undeployed multiple times
- Resolved
- is related to
-
LOG4J2-2919 "AsyncAppender is not active" when logging with AsynAppender while the system is reconfigure concurrently
- Closed
- is superceded by
-
LOG4J2-1159 ThreadLocal leaks in Tomcat8 (even if Async Loggers are not used)
- Closed
- relates to
-
LOG4J2-1171 LoggerContext names in web apps are cryptic
- Resolved