From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7503 invoked by alias); 19 Jan 2016 14:07:01 -0000 Mailing-List: contact kawa-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: kawa-owner@sourceware.org Received: (qmail 7309 invoked by uid 89); 19 Jan 2016 14:06:59 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: Yes, score=5.2 required=5.0 tests=AWL,BAYES_50,FOREIGN_BODY1,KAM_ASCII_DIVIDERS,KAM_LAZY_DOMAIN_SECURITY autolearn=no version=3.3.2 spammy=avez, melting, jar, decade X-HELO: smtp-n.oca.eu Received: from smtp-n.oca.eu (HELO smtp-n.oca.eu) (192.54.174.171) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 19 Jan 2016 14:06:53 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp-n.oca.eu (Postfix) with ESMTP id 46812555 for ; Tue, 19 Jan 2016 15:06:50 +0100 (CET) Received: from smtp-n.oca.eu ([IPv6:::ffff:192.54.174.171]) by localhost (smtp-n.oca.eu [::ffff:192.54.174.171]) (amavisd-new, port 10024) with ESMTP id odvBcNAD-Cgo for ; Tue, 19 Jan 2016 15:06:42 +0100 (CET) Received: from dhcp2-21.oca.eu (dhcp2-21.oca.eu [10.250.2.21]) by smtp-n.oca.eu (Postfix) with ESMTP id 0C08D794 for ; Tue, 19 Jan 2016 15:06:42 +0100 (CET) From: Damien MATTEI To: kawa@sourceware.org Subject: Re: kawa and apache tomcat Date: Tue, 19 Jan 2016 14:07:00 -0000 User-Agent: KMail/1.9.6 References: <201601151145.23595.Damien.Mattei@unice.fr> <56993D3C.20105@bothner.com> In-Reply-To: <56993D3C.20105@bothner.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <201601191506.41918.Damien.Mattei@unice.fr> X-IsSubscribed: yes X-SW-Source: 2016-q1/txt/msg00004.txt.bz2 Hi Mathieu and Per, sorry for my late answer but i was outside from office for few days, thank you for your answers, i tried a patch on the 2.A sources of kawa, j= ust have few problem to patch it ( i hadn't use patch command for more than= a decade),hope it'es the good way: mattei@moita kawa-2.1]$ patch < servet.patch=20 (Stripping trailing CRs from patch; use --binary to disable.) can't find file to patch at input line 5 Perhaps you should have used the -p or --strip option? The text leading up to this was: -------------------------- |Index: gnu/kawa/servlet/KawaServlet.java |=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D |--- gnu/kawa/servlet/KawaServlet.java (revision 8666) |+++ gnu/kawa/servlet/KawaServlet.java (working copy) -------------------------- File to patch: gnu/kawa/servlet/KawaServlet.java=20 patching file gnu/kawa/servlet/KawaServlet.java and run make to compile kawa-2.1. jar with sources patched and add it in th= e netbeans project the way i do it all the day to make a .war application ,= deployed it on the apache tomacat8 server but the warnings are still here in the logs when i stop the application in = tomcat8: 19-Jan-2016 11:47:28.131 SEVERE [http-nio-8080-exec-11] org.apache.catalina= .loader.WebappClassLoaderBase.checkThreadLocalMapForLeaks The web applicati= on [Sidonie] created a ThreadLocal with key of type [java.lang.ThreadLocal]= (value [java.lang.ThreadLocal@1758bda9]) and a value of type [gnu.mapping.= CallContext] (value [gnu.mapping.CallContext@7c41808c]) but failed to remov= e it when the web application was stopped. Threads are going to be renewed = over time to try and avoid a probable memory leak. 19-Jan-2016 11:47:28.131 SEVERE [http-nio-8080-exec-11] org.apache.catalina= .loader.WebappClassLoaderBase.checkThreadLocalMapForLeaks The web applicati= on [Sidonie] created a ThreadLocal with key of type [gnu.mapping.ThreadLoca= tion.ThreadLocalWithDefault] (value [gnu.mapping.ThreadLocation$ThreadLocal= WithDefault@4f731308]) and a value of type [gnu.kawa.io.BinaryOutPort] (val= ue [gnu.kawa.io.BinaryOutPort@3dcceb4c]) but failed to remove it when the w= eb application was stopped. Threads are going to be renewed over time to tr= y and avoid a probable memory leak. 19-Jan-2016 11:47:28.132 SEVERE [http-nio-8080-exec-11] org.apache.catalina= .loader.WebappClassLoaderBase.checkThreadLocalMapForLeaks The web applicati= on [Sidonie] created a ThreadLocal with key of type [gnu.mapping.Environmen= t.InheritedLocal] (value [gnu.mapping.Environment$InheritedLocal@6f2bbca9])= and a value of type [gnu.mapping.InheritingEnvironment] (value [#]) but failed to remove it when the web applicati= on was stopped. Threads are going to be renewed over time to try and avoid = a probable memory leak. 19-Jan-2016 11:47:28.132 SEVERE [http-nio-8080-exec-11] org.apache.catalina= .loader.WebappClassLoaderBase.checkThreadLocalMapForLeaks The web applicati= on [Sidonie] created a ThreadLocal with key of type [gnu.kawa.io.Path$1] (v= alue [gnu.kawa.io.Path$1@4822bf88]) and a value of type [gnu.kawa.io.FilePa= th] (value [/root]) but failed to remove it when the web application was st= opped. Threads are going to be renewed over time to try and avoid a probabl= e memory leak. 19-Jan-2016 11:47:28.132 SEVERE [http-nio-8080-exec-11] org.apache.catalina= .loader.WebappClassLoaderBase.checkThreadLocalMapForLeaks The web applicati= on [Sidonie] created a ThreadLocal with key of type [java.lang.InheritableT= hreadLocal] (value [java.lang.InheritableThreadLocal@2012835b]) and a value= of type [kawa.standard.Scheme] (value [kawa.standard.Scheme@4f423c7d]) but= failed to remove it when the web application was stopped. Threads are goin= g to be renewed over time to try and avoid a probable memory leak. 19-Jan-2016 11:47:28.133 SEVERE [http-nio-8080-exec-11] org.apache.catalina= .loader.WebappClassLoaderBase.checkThreadLocalMapForLeaks The web applicati= on [Sidonie] created a ThreadLocal with key of type [gnu.mapping.ThreadLoca= tion.ThreadLocalWithDefault] (value [gnu.mapping.ThreadLocation$ThreadLocal= WithDefault@12c104e2]) and a value of type [gnu.math.IntNum] (value [10]) b= ut failed to remove it when the web application was stopped. Threads are go= ing to be renewed over time to try and avoid a probable memory leak. unless you have others ideas i will continue because i do not think it is c= ritical for now, if under some server load it was a problem i will notice i= t , anyway i'm melting and compiling java pure source with scheme code in j= ava byte-code in kawa but also in bigloo (another scheme for C and that aha= ve also a java front end) so if there would be a real problem i can easily migrate kawa scheme routines in bigloo scheme routines if it = was necessary.=20 Regards, Damien Le Friday 15 January 2016 19:41:00, vous avez =C3=A9crit=C2=A0: >=20 > On 01/15/2016 10:10 AM, Matthieu Vachon wrote: >=20 >=20 > > This is not a problem in a standard JVM application because once the > > application closes, nothing needs to be done. But in a container > > environment, that's another story since thread a kinda re-used over > > multiple requests. On high load, this can create huge memory leaks > > depending on the what is actually stored. >=20 > As I understand it, the problem is not normal usage, but when a servlet i= s re-loaded. > That creates a new ClassLoader, with a new set of Classes which causes > some complicated interaction with the GC (which I don't properly understa= nd). >=20 > In normal usage,with no ClassLoader churn, there might be some temporary = leak, > but the garbage should become collectible when a thread services a new re= quest. >=20 > Could you try the attached patch? I haven't actually tested it (except > to verify it compiles). Let me know if it makes a difference. > It is possible it might *reduce* the number but not eliminate the > warnings. If so, we would be on the right track, though with more to do. >=20 --=20 Damien.Mattei@unice.fr, Damien.Mattei@oca.eu, UNS / OCA / CNRS