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 BEC35FDFF for ; Thu, 11 Apr 2013 14:07:35 +0000 (UTC) Received: (qmail 64698 invoked by uid 500); 11 Apr 2013 13:53:16 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 64284 invoked by uid 500); 11 Apr 2013 13:53:01 -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 64139 invoked by uid 99); 11 Apr 2013 13:52:56 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 Apr 2013 13:52:56 +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 [208.91.2.12] (HELO smtp-outbound-1.vmware.com) (208.91.2.12) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 Apr 2013 13:52:47 +0000 Received: from sc9-mailhost1.vmware.com (sc9-mailhost1.vmware.com [10.113.161.71]) by smtp-outbound-1.vmware.com (Postfix) with ESMTP id 77E8B28E8F for ; Thu, 11 Apr 2013 06:52:26 -0700 (PDT) Received: from zcs-prod-mta-2.vmware.com (zcs-prod-mta-2.vmware.com [10.113.163.64]) by sc9-mailhost1.vmware.com (Postfix) with ESMTP id 7522C187DC for ; Thu, 11 Apr 2013 06:52:26 -0700 (PDT) Received: from zcs-prod-mta-2.vmware.com (localhost.localdomain [127.0.0.1]) by zcs-prod-mta-2.vmware.com (Postfix) with ESMTP id 60464E0031 for ; Thu, 11 Apr 2013 06:52:26 -0700 (PDT) Received: from [10.16.244.67] (unknown [10.113.160.14]) by zcs-prod-mta-2.vmware.com (Postfix) with ESMTPSA id 0677DE0010 for ; Thu, 11 Apr 2013 06:52:25 -0700 (PDT) Content-Type: text/plain; charset=iso-8859-1 Mime-Version: 1.0 (Apple Message framework v1283) Subject: Re: Tomcat 6.0.35 Crashed again From: Daniel Mikusa In-Reply-To: Date: Thu, 11 Apr 2013 09:52:24 -0400 Content-Transfer-Encoding: quoted-printable Message-Id: <78E6170A-987B-48F8-907A-62EDA317DADA@vmware.com> References: To: "Tomcat Users List" X-Mailer: Apple Mail (2.1283) X-Virus-Checked: Checked by ClamAV on apache.org On Apr 11, 2013, at 1:09 AM, saumil shah wrote: > Hello All, > We are using Tomcat 6.0.35 for our production system with 64 bit JVM = (1.6.33) on Windows 2008 R2 SP1. Our physical memory is 24gb. Load is ~ = 100 concurrent sessions. > The Tomcat crashed again with OutOfMemoryError: Java heap space error. = We are using COTS product SAP Business Objects. Upon providing Tomcat = logs , > SAP came with recommendation of increasing the heap size . Our current = Java params are : > -Xms512m -Xmx1024m > -XX:MaxPermSize=3D512m > SAP's recommendation is to make it ... > -Xms1024m -Xmx4096m > We have ample of free memory on the box ... > 1a. but the question was heap size as Max 4GB , would it cause = application delay when java GC is due? It's NOT time-sensitive = application. A bigger heap will generally take longer to clean, but 4GB is not = particularly large. =20 If you're concerned about the performance of the garbage collector, I = would suggest that you enable garbage collection logging. This adds = very little overhead, simply logging an entry for every garbage = collection that occurs. Each entry will indicate memory before and = after the GC, plus how much time was spent performing the collection. = You can use that to analyze the performance for your application. > 1b. Also, when putting MAx as 4GB , does it mean JVM will make base = effort to get 4GB MAX memory for heap , or is that guaranteed? Based on = my reading, it appeared that only Min, was guaranteed. The JVM will start at -Xms and, if needed, expand up to -Xmx. > 1c. Is it then recommended to have Min and Max as 4GB... so that Heap = doesn't have to resize and 4GB is guaranteed at the time of = initialization? It depends. This can be good because it will prevent a few full GC's as = the JVM expands from -Xms to -Xmx. However, it can also waste memory if = you allocate too much. =20 > 1d. I have Tomcat service installer..... I have provided Min and Max = heap size values under Tomcat --> Java tab --> Initial Memory Pool and = Maximum memory pool ...... I am assuming that means Min and Max values = for Heap.....is this correct? Yes, I believe so. > 2. When trying to monitor Tomcat , using JConsole and VisualVM ..... = do I need to add JMX agent and port .... in Java tab of Tomcat and then = restart , or is it possible to Monitor tomcat , without rebooting it ? = Since, it would not be possible to re-boot tomcat in production for it. Normally when you run jconsole or jvisualvm on the same machine as your = Tomcat instance, you can connect without needing any additional = configuration. This is a special case because the two processes are = running on the same machine. However, I seem to remember needing to = configure JMX when running Tomcat as a Windows Service. Perhaps one of = the Windows guys on this list can clarify. > 3. Once JConsole and/or VisualVM is setup ... I can look at = Heap/Permgen , memory , threads etc...... I was wondering how do I see = memory leaks and what is causing it , using these tools? Spotting memory leaks is tricky and I'm not sure that what you're = proposing will be much help. You could certainly look at the live = graphs and watch for a trend in memory usage increasing, but if the leak = is small it would be very hard to spot. I would suggest that you add -XX:+HeapDumpOnOutOfMemoryError to your JVM = options. This will create a heap dump when you encounter an OOME. You = can then view that heap dump in jvisualvm or a profiler to see what was = consuming the memory. =20 > 4. Also, I am seeing that Tomcat is deploying the webapps on start-up = .... is there anyway to avoid Tomcat to deploy the application on = start-up....as the applications are already deployed and exploded? > Example is below :Apr 5, 2013 7:17:27 PM = org.apache.catalina.startup.HostConfig deployWARINFO: Deploying web = application archive AnalyticalReporting.war Tomcat has to deploy your application when it starts or your user's = won't be able to access it. This is normal and expected behavior. > Apr 5, 2013 7:17:28 PM org.apache.catalina.core.StandardContext = addApplicationListenerINFO: The listener = "com.sun.faces.config.ConfigureListener" is already configured for this = context. The duplicate definition has been ignored. Looks like you might have a duplicate definition in your application's = web.xml. You should remove it, but you don't have to. This is just = Tomcat telling you that the duplicate was ignored. Dan >=20 > As you can tell , I am novice to Tomcat. Please let me know if I = missed on something. > Appreciate all your help. =20 --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org