public inbox for kawa@sourceware.org
 help / color / mirror / Atom feed
From: Damien MATTEI <Damien.Mattei@unice.fr>
To: kawa@sourceware.org
Subject: Re: kawa and apache tomcat
Date: Tue, 19 Jan 2016 14:07:00 -0000	[thread overview]
Message-ID: <201601191506.41918.Damien.Mattei@unice.fr> (raw)
In-Reply-To: <56993D3C.20105@bothner.com>

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,  just 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 
(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
|===================================================================
|--- gnu/kawa/servlet/KawaServlet.java  (revision 8666)
|+++ gnu/kawa/servlet/KawaServlet.java  (working copy)
--------------------------
File to patch: gnu/kawa/servlet/KawaServlet.java 
patching file gnu/kawa/servlet/KawaServlet.java

and run make to compile kawa-2.1. jar with sources patched and add it in the 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 application [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 remove 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 application [Sidonie] created a ThreadLocal with key of type [gnu.mapping.ThreadLocation.ThreadLocalWithDefault] (value [gnu.mapping.ThreadLocation$ThreadLocalWithDefault@4f731308]) and a value of type [gnu.kawa.io.BinaryOutPort] (value [gnu.kawa.io.BinaryOutPort@3dcceb4c]) 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.
19-Jan-2016 11:47:28.132 SEVERE [http-nio-8080-exec-11] org.apache.catalina.loader.WebappClassLoaderBase.checkThreadLocalMapForLeaks The web application [Sidonie] created a ThreadLocal with key of type [gnu.mapping.Environment.InheritedLocal] (value [gnu.mapping.Environment$InheritedLocal@6f2bbca9]) and a value of type [gnu.mapping.InheritingEnvironment] (value [#<environment http-nio-8080-exec-19>]) 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.
19-Jan-2016 11:47:28.132 SEVERE [http-nio-8080-exec-11] org.apache.catalina.loader.WebappClassLoaderBase.checkThreadLocalMapForLeaks The web application [Sidonie] created a ThreadLocal with key of type [gnu.kawa.io.Path$1] (value [gnu.kawa.io.Path$1@4822bf88]) and a value of type [gnu.kawa.io.FilePath] (value [/root]) 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.
19-Jan-2016 11:47:28.132 SEVERE [http-nio-8080-exec-11] org.apache.catalina.loader.WebappClassLoaderBase.checkThreadLocalMapForLeaks The web application [Sidonie] created a ThreadLocal with key of type [java.lang.InheritableThreadLocal] (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 going 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 application [Sidonie] created a ThreadLocal with key of type [gnu.mapping.ThreadLocation.ThreadLocalWithDefault] (value [gnu.mapping.ThreadLocation$ThreadLocalWithDefault@12c104e2]) and a value of type [gnu.math.IntNum] (value [10]) 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.

unless you have others ideas i will continue because i do not think it is critical for now, if under some server load it was a problem i will notice it , anyway i'm melting and compiling java pure source with scheme code in java byte-code in kawa but also in bigloo (another scheme for C and that ahave 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. 

Regards,
Damien

Le Friday 15 January 2016 19:41:00, vous avez écrit :
> 
> On 01/15/2016 10:10 AM, Matthieu Vachon wrote:
> 
> 
> > 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.
> 
> As I understand it, the problem is not normal usage, but when a servlet is 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 understand).
> 
> 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 request.
> 
> 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.
> 



-- 
Damien.Mattei@unice.fr, Damien.Mattei@oca.eu, UNS / OCA / CNRS

      reply	other threads:[~2016-01-19 14:07 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-15 10:53 Damien MATTEI
2016-01-15 18:10 ` Matthieu Vachon
2016-01-15 18:41   ` Per Bothner
2016-01-19 14:07     ` Damien MATTEI [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201601191506.41918.Damien.Mattei@unice.fr \
    --to=damien.mattei@unice.fr \
    --cc=kawa@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).