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 ECACE10DE1 for ; Mon, 9 Dec 2013 22:39:15 +0000 (UTC) Received: (qmail 87502 invoked by uid 500); 9 Dec 2013 22:39:11 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 87428 invoked by uid 500); 9 Dec 2013 22:39:11 -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 87387 invoked by uid 99); 9 Dec 2013 22:39:11 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 09 Dec 2013 22:39:11 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of billdsd@gmail.com designates 209.85.192.180 as permitted sender) Received: from [209.85.192.180] (HELO mail-pd0-f180.google.com) (209.85.192.180) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 09 Dec 2013 22:39:03 +0000 Received: by mail-pd0-f180.google.com with SMTP id q10so6032391pdj.39 for ; Mon, 09 Dec 2013 14:38:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding; bh=SWU700B6fTruzzafeSPae48t4rZ7QmL7mS1H//ANVJk=; b=YkN6lbs1I4xbROfEXAvZr1h5Sou6i0NYeP2eJSIzHB6blwiivthXytY0bs/Us8xR4K h+rKyqZ/Fdt1GiXG8gXBry58cXijvVAAQCeocHv4XRsV2UWgL3l7dZqMxN4ePj6+pIXS fsvVz/pSKWigyLjMwUv7DPkv+TrSCsYikn8VcOxiyrZHbJgosSmXA0hFiZ5qM6Ouvsdu TBmFnDC5/abtLcJpzXb3xrI2z0Me0obwPOJ73kuIpAM9gl7mxIlptlAoRcujxocR8DOh CIJ8qu6mrMj/e6TMqBJvjZD1FFnlM1D1SUFgny7CjSDWa7VF2YqUW+CUbt6/Juv/Xhfi 3cLw== X-Received: by 10.69.29.107 with SMTP id jv11mr23874987pbd.147.1386628722604; Mon, 09 Dec 2013 14:38:42 -0800 (PST) Received: from [192.168.1.81] (wsip-70-166-86-118.sd.sd.cox.net. [70.166.86.118]) by mx.google.com with ESMTPSA id vf7sm20606770pbc.5.2013.12.09.14.38.41 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 09 Dec 2013 14:38:41 -0800 (PST) Message-ID: <52A64675.1030600@gmail.com> Date: Mon, 09 Dec 2013 14:38:45 -0800 From: Bill Davidson User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.0 MIME-Version: 1.0 To: users@tomcat.apache.org Subject: Notification strategy for OutOfMemoryError Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Last week, one of my servers got an OutOfMemoryError at approximately 1:21pm. My monitoring software which does a heart beat check once per minute did not notice until 3:01pm. Heart beat kept working for over an hour and a half. During that time my high capacity high availablity 24/7 application was getting occasional OutOfMemoryError's until memory got bad enough that even the heart beat check servlet failed. Apparently some things that allocate large chunks of memory started failing first, but none of my customers called to complain. Smaller stuff continiued to work. I didn't know until my monitoring software sent me an email about the heart beat failure. That doesn't work for me. I need to know sooner. I thought of trying to handle it with error-page in web.xml. Apparently that does not work. I used java.lang.Throwable as the exception-type. I was already using this for a number of common exceptions to send me email. I see the OutOfMemoryError's logged in my catalina.out Is there some way that I can catch this so that I can send email or something? I need to know as soon as possible so that I can attempt diagnosis and restart the server. Google has not been helpful. Everything says that you have to fix the memory leak. Duh. I know that. We've fixed many over the years. We haven't had one in nearly 2 years. We thought we'd fixed them all. We need to find out about them sooner when they do happen. This was on Tomcat 6.0.37 in production but we are about to upgrade to 7.0.47 and have been using that in development for a little over a month. My testing has been in development (7.0.47) and I tested by explicitly throwing OutOfMemoryError from a servlet. Logged in catalina.out but no other indication that it happened. My error page does not get called. java.lang.Throwable /jsp/error/Error.jsp RedHat EL 5.9. Java 7.0.25 64-bit. Heap size 3GB. --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org