From users-return-233329-apmail-tomcat-users-archive=tomcat.apache.org@tomcat.apache.org Wed Apr 4 12:55:02 2012 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 719719BDD for ; Wed, 4 Apr 2012 12:55:02 +0000 (UTC) Received: (qmail 36166 invoked by uid 500); 4 Apr 2012 12:54:59 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 36050 invoked by uid 500); 4 Apr 2012 12:54:59 -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 36041 invoked by uid 99); 4 Apr 2012 12:54:59 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 04 Apr 2012 12:54:58 +0000 X-ASF-Spam-Status: No, hits=4.7 required=5.0 tests=FREEMAIL_FORGED_REPLYTO,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [98.138.91.88] (HELO nm12-vm2.bullet.mail.ne1.yahoo.com) (98.138.91.88) by apache.org (qpsmtpd/0.29) with SMTP; Wed, 04 Apr 2012 12:54:50 +0000 Received: from [98.138.90.55] by nm12.bullet.mail.ne1.yahoo.com with NNFMP; 04 Apr 2012 12:54:29 -0000 Received: from [98.138.87.8] by tm8.bullet.mail.ne1.yahoo.com with NNFMP; 04 Apr 2012 12:54:29 -0000 Received: from [127.0.0.1] by omp1008.mail.ne1.yahoo.com with NNFMP; 04 Apr 2012 12:54:29 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 686446.27249.bm@omp1008.mail.ne1.yahoo.com Received: (qmail 72761 invoked by uid 60001); 4 Apr 2012 12:54:29 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1333544069; bh=PZkwJXiJ666KU529KiXP3vAr7uq9ACvBClgCaDBDHNo=; h=X-YMail-OSG:Received:X-Mailer:References:Message-ID:Date:From:Reply-To:Subject:To:In-Reply-To:MIME-Version:Content-Type; b=desHyGun7ZD0tdwkeZeiZTOptZV+1DdUqaoR4fKwDBXou++7z9pwJPC4vd9nRjl3ZrY0gn160ahwrghTf7j8riJymqXjT5Bw0WpXcrBUUX/iRgkKsvrsQasBnvBfDBmAozSoXQ+lrPvKZrgjv9EQ5xx5W2+f7FuBpk2QtX035Iw= DomainKey-Signature:a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:X-Mailer:References:Message-ID:Date:From:Reply-To:Subject:To:In-Reply-To:MIME-Version:Content-Type; b=Sx2ST+5SXv4exsDSpUrJ/ErNbAfCKb8QaBlE3X60O8+LDTKDl6PSvxy8wf5rLnWu+Gfe5xrBn9wyYUCxdvdaqw3dLjkq2hDuZXSYnB8M2AnipC2QpgCF9kyoQHsgYIefClOER922hK4DAy3FJZHYrRoN0Gihq6WgiuFQ273lmE8=; X-YMail-OSG: X6d8AhkVM1myBerhZQWoNxHIo9POnKjwVhpEVYF1001AFOa bmCpI5whGoZpv1A6la6U5vZ599Wqu8aKzcRQshW1fq_XeZiYjckYIlHLST5p Wu0HIHufrq11MMxCrgwa8zzPhfcAqM4aHCrf0.G_BxZ4Z3LpPNTT1UI1B5Ip GKbiLIz8RsAwOMrS5WuE7Z9ArUgj..TkdxAIA705kiQsxJJ24TCHYS0980l2 0v8Put3OSCnXjsAGmbg7L352P.9WZfC8ut1KbgVsKLNGGy8Lkp0NlQ2DvrYP a_0PenG6cD0HQTA6MaM3YMJarADd_LS7uhp_JRXr4jsdpNbxFzikmmjm1dOk PSNAZg8fo0vjf7KU15mo_WoRir2Xlf2T7qgA5x_OLKv9xNfm2yNvR7LfAs7y vCF4GkH1udzyJAZNYmcZ2r6_4Iw-- Received: from [62.134.46.5] by web122303.mail.ne1.yahoo.com via HTTP; Wed, 04 Apr 2012 05:54:29 PDT X-Mailer: YahooMailWebService/0.8.117.340979 References: <1333541107.27592.YahooMailNeo@web122304.mail.ne1.yahoo.com> <4F7C420C.8070401@pidster.com> Message-ID: <1333544069.69754.YahooMailNeo@web122303.mail.ne1.yahoo.com> Date: Wed, 4 Apr 2012 05:54:29 -0700 (PDT) From: Hermes Flying Reply-To: Hermes Flying Subject: Re: Discrepancy between Tomcat's connection pool and tomcat's report on memory leaks To: Tomcat Users List , "pid@pidster.com" In-Reply-To: <4F7C420C.8070401@pidster.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="-1062763926-1238691080-1333544069=:69754" X-Virus-Checked: Checked by ClamAV on apache.org ---1062763926-1238691080-1333544069=:69754 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Hi Pid,=0A=0AThis is the configuration=0AThe following entry is in server.x= ml =0A=0A=A0=0A=0A=0AAnd the= following entry is under $TOMCAT_HOME/conf/context.xml=0A=0A=A0=0A=0AConcerning your other questi= ons:=0A1) Yes I could shut down the database manually but I would like to d= o it as a last resort if this issue is something that can not be fixed sinc= e I believe that my setup is correct and should be supported as is=0A=0A2) = You say that it depends if I should close down the connection myself. But h= ow can I do that? A javax.sql.DataSource does not provide a close method. I= would have to cast to org.apache.tomcat.dbcp.dbcp.BasicDataSource to call = close. I am not sure if this is the proper approach. I mean I then get bind= to this class, right? Or there is another way?=0A=0AThank you=0A=0A=0A=0A_= _______________________________=0A From: Pid =0ATo: Tomcat= Users List =0ASent: Wednesday, April 4, 2012 3:4= 3 PM=0ASubject: Re: Discrepancy between Tomcat's connection pool and tomcat= 's report on memory leaks=0A =0AOn 04/04/2012 13:05, Hermes Flying wrote:= =0A> Hi,=0A> =0A> I am using Tomcat 7.0.25 in a Linux machine=0A> =0A> I am= using Tomcat's connection pool (org.apache.tomcat.dbcp.dbcp.BasicDataSourc= e). As database I am using H2 as a file database.=0A> All is ok, but I have= the following problem.=0A> On shutdown of Tomcat I see in catalina.out: = =0A=0AIn which file have you defined the pool?=0A=0A=0A> SEVERE: The web ap= plication [/GeneralApplication] appears to have started a thread named [H2 = Log Writer GENERICAPPLICATION] but has failed to stop it. This is very like= ly to create a memory leak.=0A> Apr 4, 2012 2:32:54 PM org.apache.catalina.= loader.WebappClassLoader clearReferencesThreads=0A> SEVERE: The web applica= tion [/GeneralApplication] appears to have started a thread named [H2 File = Lock Watchdog /opt/en/repos/tomcat/webapps/GeneralApplication/db/internalda= tabase.lock.db] but has failed to stop it. This is very likely to create a = memory leak.=0A> =0A> Why do I get these messages?=0A=0AWhen the applicatio= n shuts down Tomcat tries to detect & prevent memory=0Aleaks by examining t= hreads & various things associated with the=0AWebappClassloader.=0A=0A=0A> = As I understand these messages, H2 is still running on shutdown and the doc= umentation they have says that the database will shutdown once the last con= nection is closed (and the connections are handled by the pool i.e. Tomcat)= =0A=0ASo there is no way to manually the database down?=0A=0A=0A> Additiona= lly the input from H2 dev is that these messages are a Tomcat problem. Tomc= at should have first disposed of the connection pool and then log the runni= ng threads.Their explanation seem correct to me.=0A=0AThat's the usual firs= t response.=A0 Let's figure out whether it's correct...=0A=0A=0A> Is this a= known issue? =0A=0ANot that I've come across here.=0A=0A> Why do I see the= se errors in catalina? =0A=0AAs above.=0A=0A> Should I somehow dispose off = the connection pool myself?=0A=0ADepends.=0A=0A=0Ap=0A=0A> Thank you for yo= ur time=0A> Best Regards,=0A> FH=0A> =0A=0A=0A-- =0A=0A[key:62590808] ---1062763926-1238691080-1333544069=:69754--