Return-Path: X-Original-To: apmail-tomcat-users-archive@www.apache.org Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 23916DF15 for ; Tue, 6 Nov 2012 15:37:37 +0000 (UTC) Received: (qmail 87538 invoked by uid 500); 6 Nov 2012 15:37:33 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 87419 invoked by uid 500); 6 Nov 2012 15:37:33 -0000 Mailing-List: contact users-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Users List" Delivered-To: mailing list users@tomcat.apache.org Received: (qmail 87398 invoked by uid 99); 6 Nov 2012 15:37:32 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Nov 2012 15:37:32 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of knst.kolinko@gmail.com designates 209.85.212.45 as permitted sender) Received: from [209.85.212.45] (HELO mail-vb0-f45.google.com) (209.85.212.45) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Nov 2012 15:37:27 +0000 Received: by mail-vb0-f45.google.com with SMTP id p1so723330vbi.18 for ; Tue, 06 Nov 2012 07:37:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=03J52ywXFejfXmCB+2Z3mx1G79DtOJHb2VxOY/FQ2TA=; b=JOxKb9XKXgkac1lXldX3tGWDLalkWcvF3S8k9B/dTmsDV94vKLsay+hqCXXn5iRkLK qWHVuVa2IyUMPg4rEaykbx/hCxDwvN/nLyzGDKri9tRnF1R08Ynvzc03L7AF1/aTUPkr 8Zh9RvlV/V21Dm0Tx0P7YYgEi5d7FPc0/xX2o6knMngk1Qj7DHIq/LeyVYiSpn7C6RLF HBEeIamW+7RRBzgT31p5YDNV2RdN5/wKWCLyArNz8cA8zIIl42m6kRnZrJH9eRIcDWOQ BadkdLwCxxWWBkarQS+To2sx9cHvaNPDaOkAqagvOfmuiwPSeNOTjyM1epo6Ql0ASmS4 zKFQ== MIME-Version: 1.0 Received: by 10.52.99.40 with SMTP id en8mr1045400vdb.70.1352216227136; Tue, 06 Nov 2012 07:37:07 -0800 (PST) Received: by 10.58.249.199 with HTTP; Tue, 6 Nov 2012 07:37:07 -0800 (PST) In-Reply-To: <50981D76.7040505@christopherschultz.net> References: <50981D76.7040505@christopherschultz.net> Date: Tue, 6 Nov 2012 19:37:07 +0400 Message-ID: Subject: Re: WebappClassLoader weak/soft reachable From: Konstantin Kolinko To: Tomcat Users List Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Checked: Checked by ClamAV on apache.org 2012/11/6 Christopher Schultz : > > I was playing around with the manager webapp today and just for grins, > I redeployed my webapp and then hit the "Find Leaks" button to see how > long it would take Tomcat to decide that my webapp reloads cleanly. > > It didn't. That is, my webapp does not appear to cleanly reload. Which > was a surprise to me. > > I waited a few moments and tried again: Find Leaks still says "there's > a leak, confirm with a profiler". So I attached with YourKit, took a > memory snapshot and started looking around: I found 4 > WebappClassLoaders (1 for manager, 1 for my webapp, 1 for a dummy ROOT > webapp I have and finally a started=false WebappClassLoader for the > old pre-reload of my webapp). > > Interestingly, the started=false WebappClassLoader says that it is > Weak/Soft Reachable. That means that tracing GC roots doesn't really work. > > Requesting GC via the manager changes nothing. Requesting GC via the > profiler changes nothing. > > Does anyone have any good ideas for tracking-down what is keeping this > WebappClassLoader in memory? Do I just have to intentionally exhaust > the heap to convince the MM/GC that it should toss-out this WCL? > > Any suggestions would be greatly appreciated. > 1) There exists an -X option that disables explicit GC calls. I hope that you are not using it. 2) I know of a bug in JVM when a certain kind of leak goes undetected. I mean the leak through a shared Exception instance and its native stacktrace. See https://issues.apache.org/bugzilla/show_bug.cgi?id=50460 https://issues.apache.org/bugzilla/show_bug.cgi?id=53936 (Linked from https://wiki.apache.org/tomcat/MemoryLeakProtection) Best regards, Konstantin Kolinko --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org