Return-Path: X-Original-To: apmail-db-derby-dev-archive@www.apache.org Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 7FBAA9DF2 for ; Thu, 1 Mar 2012 15:12:16 +0000 (UTC) Received: (qmail 1812 invoked by uid 500); 1 Mar 2012 15:12:16 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 1794 invoked by uid 500); 1 Mar 2012 15:12:16 -0000 Mailing-List: contact derby-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 1787 invoked by uid 99); 1 Mar 2012 15:12:16 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Mar 2012 15:12:16 +0000 X-ASF-Spam-Status: No, hits=-5.0 required=5.0 tests=RCVD_IN_DNSWL_HI,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [141.146.126.227] (HELO acsinet15.oracle.com) (141.146.126.227) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Mar 2012 15:12:07 +0000 Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238]) by acsinet15.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with ESMTP id q21FBjS5005269 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 1 Mar 2012 15:11:46 GMT Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158]) by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id q21FBiHs026254 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 1 Mar 2012 15:11:45 GMT Received: from abhmt112.oracle.com (abhmt112.oracle.com [141.146.116.64]) by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id q21FBiJk001697 for ; Thu, 1 Mar 2012 09:11:44 -0600 Received: from [192.168.0.3] (/84.215.180.161) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 01 Mar 2012 07:11:44 -0800 Message-ID: <4F4F91A9.1040606@oracle.com> Date: Thu, 01 Mar 2012 16:11:37 +0100 From: Kristian Waagan User-Agent: Mozilla/5.0 (Windows NT 6.0; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2 MIME-Version: 1.0 To: derby-dev@db.apache.org Subject: Re: How to present a heap dump to the list - Was: Had Derby 10.8.2.2 fail today and need some thoughts References: <97EB699F861AD841B5908C7CA9C9565602065A079A4D@VSERVER1.canoga.com>,<4F4D65F8.3060707@sbcglobal.net> <97EB699F861AD841B5908C7CA9C95656020656A10941@VSERVER1.canoga.com> <97EB699F861AD841B5908C7CA9C9565602065A079B74@VSERVER1.canoga.com> <97EB699F861AD841B5908C7CA9C9565602065A079B7B@VSERVER1.canoga.com> In-Reply-To: <97EB699F861AD841B5908C7CA9C9565602065A079B7B@VSERVER1.canoga.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Source-IP: acsinet22.oracle.com [141.146.126.238] X-Auth-Type: Internal IP X-CT-RefId: str=0001.0A090207.4F4F91B2.009B,ss=1,re=0.000,fgs=0 X-Virus-Checked: Checked by ClamAV on apache.org On 01.03.2012 15:55, Bergquist, Brett wrote: > I think I can explain the "org.apache.derby.jdbc.XATransactionState$CancelXATransactionTask" instances that are piling up in memory. Haven't read what you say below, I really have to run, but see also DERBY-4137 [1]. Maybe you're a good reason why we should implement the more complex solution :) Cheers, -- Kristian [1] https://issues.apache.org/jira/browse/DERBY-4137 > > I have derby.properties configured to timeout XA transactions at 15 minutes. The system is processing about 6M or so XA transactions a day or about 70/second and 99.9% of these are going to work and not be canceled by the Derby XA transaction timer. So each of these invokes "cancel" when the XA transaction is finalized or canceled or committed. The CancelXATransactionTask instance is marked as canceled when this done. > > The java.util.Timer does not remove these canceled tasks until their original schedule time occurs however. When that happens, the task is seen as canceled and removed from the queue that is maintained by java.util.Timer. > > So from what I see, CancelXATransactionTask are being added to the java.util.Timer queue at a rate of about 70/second and are being canceled but each of these is sticking around in the queue for 15 minutes. So these build up in the queue for at least 15 minutes of time and then start being purged out. I guess this should reach a steady state after a while where adding to the queue and the removing from the queue reaches an equilibrium. > > The java.util.Timer class does have "purge" method. Since most XA transactions are not going to timeout and the CancelXATransactionTask is going to be canceled, I am wondering if it might not be wise to schedule a call to "purge" periodically to remove these canceled timers from the Timer's queue early? > > > > -----Original Message----- > From: Bergquist, Brett [mailto:BBergquist@canoga.com] > Sent: Thursday, March 01, 2012 9:01 AM > To: derby-dev@db.apache.org > Subject: How to present a heap dump to the list - Was: Had Derby 10.8.2.2 fail today and need some thoughts > > I have a couple of heap dumps that I can bring up in jvisualvm. One is an 8Gb dump of where Derby had an OOM when doing a large query and one is just a snapshot of the heap of a running system that I see about 121K instances of "org.apache.derby.jdbc.XATransactionState$CancelXATransactionTask". Jvisualvm is able to load these heap dumps but does not seem to have a good way of outputting a report. > > I could do a screen capture and attach a JPEG, but I want to make sure this is proper etiquette for the list before doing so. > > So any advice on this will be appreciated. > > Brett > > -----Original Message----- > From: Bergquist, Brett [mailto:BBergquist@canoga.com] > Sent: Tuesday, February 28, 2012 7:41 PM > To: derby-dev@db.apache.org > Subject: RE: Had Derby 10.8.2.2 fail today and need some thoughts > > Hardware is Oracle M5000 running Solaris 10. Database engine is controlled through SMF of Solaris. derby.properties is setup to always append to the log, never truncate. There definitely is not more than one process starting the Network Server. > > Here is another tidbit. Even though the log says the Derby engine was shutting down, the process was still alive (prstat showed this) and the SMF log also showed that the Network Server process never terminated. > > From a previous capture of the "derby.log", it also appeared this happened on the Feb 24'th as well, but seemed to recover and continue running. Strange? > > On an separate thought in case it has to do with an out of memory condition, I was using jvisualvm the other day and monitoring the heap/garbage collection on a test system that tries to mimic this setup (Oracle M3000). I did a heap dump an noticed many objects relating to XA transaction timeout timers. About 600K of these. They seemed to be owned by java.util.TimerTask. I remember seeing some Derby issue updated yesterday or the day before about java.util.TimerTask holding on to some things. I bring this up because recently we added the property to derby.properties to cancel XA transactions if they take to long. We probably do about 6M XA transactions a day and I am wondering if maybe there is some sort of leak here. I will try my setup and look again tomorrow using jvisualvm. > > I appreciate your thoughts. > > Brett > ________________________________________ > From: Mike Matrigali [mikem_app@sbcglobal.net] > Sent: Tuesday, February 28, 2012 6:40 PM > To: derby-dev@db.apache.org > Subject: Re: Had Derby 10.8.2.2 fail today and need some thoughts > > Don't know by more info might help. A catch 22 is that usually the top of the derby.log usually has all the environment info that could be useful. > > Can you list OS, JVM. I/O handling to the log is likely an OS thing. What properties do you have set, any special for error logging? > > I would likely look first for multiple starts and stops of derby and a setting default for one of them to truncate the derby.log. > Maybe leading to multiple processes trying to write to same derby.log. > > /mikem > > Bergquist, Brett wrote: >> Our customer called and said the server was not working. Before >> restarting, I retrieved the derby.log and it seems strange because >> this was right at the top of the log: >> >> >> >> ---------------------------------------------------------------- >> >> Tue Feb 28 15:33:58 EST 2012: Shutting down Derby engine >> >> ---------------------------------------------------------------- >> >> Tue Feb 28 15:37:28 EST 2012 Thread[DRDAConnThread_245,5,main] (XID = >> 1482003981), (SESSIONID = 133257672), (DATABASE = csemdb), (DRDAID = >> ????????.??-4471791624540787385{335696}), Cleanup action starting >> >> Tue Feb 28 15:37:28 EST 2012 Thread[DRDAConnThread_245,5,main] (XID = >> 1482003981), (SESSIONID = 133257672), (DATABASE = csemdb), (DRDAID = >> ????????.??-4471791624540787385{335696}), Failed Statement is: null >> >> java.lang.NullPointerException >> >> Cleanup action completed >> >> >> >> The strange part is "Shutting down Derby engine" is the first thing in >> the log. The server was up and running since 2/16/2012 with no >> problems with about 60M transactions processed, a backup performed each >> night, etc. And then this. >> >> >> >> So any thoughts on how the derby.log could be recreated and have this as >> the first thing in the log? I am thinking maybe an OutOfMemory >> condition but all traces of whatever when wrong are gone, so I am >> trying to work backwards and see how the derby.log could be created >> with this as the first thing in the log. >> >> >> >> Thanks for any help! >> >> >> >> Brett >> >> >> >> >> > > > > > > >