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=512m > 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. 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. > 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. > 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 > > As you can tell , I am novice to Tomcat. Please let me know if I missed on > something. > Appreciate all your help. --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org