Return-Path: X-Original-To: apmail-logging-log4j-user-archive@www.apache.org Delivered-To: apmail-logging-log4j-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 355EE189C1 for ; Fri, 18 Dec 2015 01:07:04 +0000 (UTC) Received: (qmail 53308 invoked by uid 500); 18 Dec 2015 01:07:03 -0000 Delivered-To: apmail-logging-log4j-user-archive@logging.apache.org Received: (qmail 53259 invoked by uid 500); 18 Dec 2015 01:07:03 -0000 Mailing-List: contact log4j-user-help@logging.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Log4J Users List" Reply-To: "Log4J Users List" Delivered-To: mailing list log4j-user@logging.apache.org Received: (qmail 53248 invoked by uid 99); 18 Dec 2015 01:07:03 -0000 Received: from Unknown (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 18 Dec 2015 01:07:03 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 67042C8A03 for ; Fri, 18 Dec 2015 01:07:03 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.001 X-Spam-Level: X-Spam-Status: No, score=0.001 tagged_above=-999 required=6.31 tests=[URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-us-east.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id yqWDCS83X5Bj for ; Fri, 18 Dec 2015 01:06:52 +0000 (UTC) Received: from smtp754.redcondor.net (smtp754.redcondor.net [208.80.206.54]) by mx1-us-east.apache.org (ASF Mail Server at mx1-us-east.apache.org) with ESMTPS id 61EB3439EF for ; Fri, 18 Dec 2015 01:06:52 +0000 (UTC) Received: from mailproxy12.neonova.net ([137.118.22.77]) by smtp754.redcondor.net ({97b16bb2-c597-43ea-8fbe-137c536017bc}) via TCP (outbound) with ESMTP id 20151218010642933_0754; Fri, 18 Dec 2015 01:06:42 +0000 X-RC-FROM: Received: from [192.168.1.14] (ip72-201-43-179.ph.ph.cox.net [72.201.43.179]) (Authenticated sender: ralph.goers@dslextreme.com) by mailproxy12.neonova.net (Postfix) with ESMTPA id 59586360083; Thu, 17 Dec 2015 20:06:38 -0500 (EST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Subject: Re: still: Memoryleak - org.apache.log4j.helpers.ThreadLocalMap From: Ralph Goers In-Reply-To: <975545136.351334.1450380617274.JavaMail.yahoo@mail.yahoo.com> Date: Thu, 17 Dec 2015 18:06:36 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: References: <975545136.351334.1450380617274.JavaMail.yahoo@mail.yahoo.com> To: Log4J Users List , Dave Glasser X-Mailer: Apple Mail (2.2104) X-DLP-ENABLED: 137.118.22.64/27 X-MAG-OUTBOUND: greymail.redcondor.net@137.118.22.64/27 Looking at the IBM support web site it seems Websphere AS 7 standard = support would have ended in 2013 and enhanced support will end in 2016, = AS 8.0 standard support will end next July with enhanced support = continuing until 2019. Only Websphere 8.5 supports Java 7. Weblogic Server 10 had a premier end of support date of 2014 and an = extended end of support date of 2017. I didn=E2=80=99t look to see what = Java versions it supported. =46rom what I can tell Weblogic server 11g = supports Java 7. In general, Oracle seems to say they support any = =E2=80=9CCertified Java Version=E2=80=9D. Ralph > On Dec 17, 2015, at 12:30 PM, Dave Glasser wrote: >=20 > To any Log4j devs on the list, if Veit has found a bug in 1.2.17, = please, please, fix it and release 1.2.18. I cannot use 2.5 because my = code has to run under Java 1.6. I suspect that is the case with a lot of = developers who deploy on WebSphere or WebLogic.=20 >=20 >=20 >=20 > From: Veit Guna > To: log4j-user@logging.apache.org=20 > Sent: Thursday, December 17, 2015 12:36 PM > Subject: still: Memoryleak - org.apache.log4j.helpers.ThreadLocalMap >=20 > Hi. >=20 > We're developing a Jersey 2(.22.1) REST service with JDK8, log4j = 1.2.16 > and SLF4J 1.7.7 using Tomcat 8.0.23. >=20 > Recently I stumbled across the problem mentioned here: >=20 > https://bz.apache.org/bugzilla/show_bug.cgi?id=3D50486 >=20 > Where Tomcat complains about left behind ThreadLocalMaps. >=20 > I updated to 1.2.17 which claims to fix the mentioned problem. > On first sight, it did. Starting the server and immediately stopping = it > showed no warning anymore - before it did. Yay! >=20 > But then I drove some loadtests against our REST service and after > stopping it the same message appeared again :(. >=20 > I double checked that our MDC put/remove is performed within a > try/finally within a http filter. I also logged, what values > were put and removed from the MDC - everyting as expected. > I also made sure, that the key was really removed after > MDC.remove() by getting the key from the MDC again: null. >=20 > Tomcat complained about a specific key/value in the ThreadLocalMap. > I checked, that this key/value was logged before - and it was > logged as "removed". So somehow it wasn't _really_ removed. >=20 > I digged deeper into the rabbit hole and found this peace of code: >=20 > --cut here-- > final public class ThreadLocalMap extends InheritableThreadLocal { >=20 > public > final > Object childValue(Object parentValue) { > Hashtable ht =3D (Hashtable) parentValue; > if(ht !=3D null) { > return ht.clone(); > } else { > return null; > } > } > } > --cut here-- >=20 > At this point, the hashtable containing the key/values is cloned > when a child thread is spawned. That would explain, why I see that > the complained key/value still exists, although I removed it from the > MDC. It still exists in the cloned instance on the spawned child = thread > I guess! >=20 > I verified it by debugging within eclipse and set a breakpoint there, > simply returning null instead of ht.clone(). And voila: no complaining > anymore when shutting down. >=20 > Since I'm not too deep into log4j, could someone of the devs please > shed some light on this, please? >=20 > I'm wondering, who will remove the ThreadLocalMap on the spawned child > threads? Since MDC.remove() will do this only on my parent thread > manually kicked by the filter. >=20 > Or, maybe I'm completely wrong with this :). >=20 > Thanks > Veit >=20 >=20 >=20 >=20 >=20 >=20 >=20 >=20 > =20 > =20 >=20 > --------------------------------------------------------------------- > To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org > For additional commands, e-mail: log4j-user-help@logging.apache.org >=20 >=20 --------------------------------------------------------------------- To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org For additional commands, e-mail: log4j-user-help@logging.apache.org