RE: Memory settings
Thanks, I'm trying the JConsole, but I'm not sure I'm connecting to the relevant process? There are two local processes that I can connect to, one seems to be the JConsole itself, then other has no name. If I stop the Tomcat service, there are still the same to processes that I can connect to!? --- On Tue, 3/9/10, Caldarale, Charles R chuck.caldar...@unisys.com wrote: From: Caldarale, Charles R chuck.caldar...@unisys.com Subject: RE: Memory settings To: Tomcat Users List users@tomcat.apache.org Date: Tuesday, March 9, 2010, 10:34 PM From: Mats Eklund [mailto:mats.ekl...@yahoo.com] Subject: Re: Memory settings In the Java tab I have the Java Options field with parameters such as -Dcatalina.home So I just add another few lines to it with the - Xms... parameters? The -Xmx and -Xms settings should be specified in the extra memory pool boxes provided; the others go in the regular options box. Keep the initial and maximum memory pool sizes the same to avoid heap thrashing. And finally, when nothing is specified here, what are the defaults? Depends on the JVM version, the mode of the JVM, and the platform you're running on. Easiest just to crank up JConsole and take a look. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: Memory settings
From: Mats Eklund [mailto:mats.ekl...@yahoo.com] Subject: RE: Memory settings Thanks, I'm trying the JConsole, but I'm not sure I'm connecting to the relevant process? What flavor of Windows are you using? If it's Vista, 2008, or later, you won't be able to access the service unless you run JConsole under the same account that the service is running under (and sometimes not even then - thank you, Microsoft) - even if you're an administrator. But you don't need to access the Tomcat service to determine the default; just start a sleep-forever Java program using the same JVM and mode (client or server) that Tomcat is using, and attach JConsole to that. The default heap size will show up in the VM Summary window. Running JConsole on itself might not give you the right information, since you don't know which JVM or mode it's using, or if it fiddles with the heap size before starting its JVM. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Memory settings
Mats Eklund wrote: Hi, I'm using Tomcat 5.5 on Windows and am sometimes experiencing exceptions thrown in my web application: java.lang.OutOfMemoryError: Java heap space. I will profile my application to see if this can be avoided by changing the code, however, I'm also interested to know whether and how memory available to the application can be configured. Short version : (Presuming you installed Tomcat using the service installer,) go to the Tomcat/bin directory and double-click the tomcat5w.exe program. This is a GUI allowing you, in one of the tabs, to set the JVM options used to run Java, which runs Tomcat. Use the options -Xms256m -Xmx256m for example to set the size of the Heap at start to 256 MB (-Xms) and maximum size 256 MB (-Xmx). Setting both to the same value is a bit more efficient, because it avoids the JVM having to keep track and resize this dynamically. Long version : http://java.sun.com/javase/technologies/hotspot/gc/index.jsp http://java.sun.com/javase/technologies/hotspot/gc/memorymanagement_whitepaper.pdf - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: Memory settings
From: Mats Eklund [mailto:mats.ekl...@yahoo.com] Subject: Memory settings I'm also interested to know whether and how memory available to the application can be configured. Memory isn't configured for individual webapps, it's done for the whole JVM. The standard settings (-Xmx, -Xms, -XX:MaxPermSize, etc.) all work with Tomcat. If you're running Tomcat as a service, use the Java tab of the tomcat5w.exe program to set the values. If you're running it from the .bat scripts, create a setenv.bat script of your own and specify the heap settings in the environment variable CATALINA_OPTS; Tomcat will automatically call this script (if it exists) when it starts. Also read the FAQ: http://wiki.apache.org/tomcat/FAQ/Memory (Just substitute CATALINA_OPTS for JAVA_OPTS in the FAQ text.) - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Memory settings
Thanks a lot! In the Java tab I have the Java Options field with parameters such as -Dcatalina.home So I just add another few lines to it with the -Xms... parameters? There are a few fields below that field called: initial memory pool, maximum memory pool, thread stack size. Should I maybe use these fields instead? And finally, when nothing is specified here, what are the defaults? I have tried to find out by looking into some log files but havent found anything. --- On Tue, 3/9/10, André Warnier a...@ice-sa.com wrote: From: André Warnier a...@ice-sa.com Subject: Re: Memory settings To: Tomcat Users List users@tomcat.apache.org Date: Tuesday, March 9, 2010, 9:59 PM Mats Eklund wrote: Hi, I'm using Tomcat 5.5 on Windows and am sometimes experiencing exceptions thrown in my web application: java.lang.OutOfMemoryError: Java heap space. I will profile my application to see if this can be avoided by changing the code, however, I'm also interested to know whether and how memory available to the application can be configured. Short version : (Presuming you installed Tomcat using the service installer,) go to the Tomcat/bin directory and double-click the tomcat5w.exe program. This is a GUI allowing you, in one of the tabs, to set the JVM options used to run Java, which runs Tomcat. Use the options -Xms256m -Xmx256m for example to set the size of the Heap at start to 256 MB (-Xms) and maximum size 256 MB (-Xmx). Setting both to the same value is a bit more efficient, because it avoids the JVM having to keep track and resize this dynamically. Long version : http://java.sun.com/javase/technologies/hotspot/gc/index.jsp http://java.sun.com/javase/technologies/hotspot/gc/memorymanagement_whitepaper.pdf - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: Memory settings
From: Mats Eklund [mailto:mats.ekl...@yahoo.com] Subject: Re: Memory settings In the Java tab I have the Java Options field with parameters such as -Dcatalina.home So I just add another few lines to it with the - Xms... parameters? The -Xmx and -Xms settings should be specified in the extra memory pool boxes provided; the others go in the regular options box. Keep the initial and maximum memory pool sizes the same to avoid heap thrashing. And finally, when nothing is specified here, what are the defaults? Depends on the JVM version, the mode of the JVM, and the platform you're running on. Easiest just to crank up JConsole and take a look. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Memory settings
Mats Eklund wrote: Thanks a lot! In the Java tab I have the Java Options field with parameters such as -Dcatalina.home So I just add another few lines to it with the -Xms... parameters? Basically, yes. But see below. There are a few fields below that field called: initial memory pool, maximum memory pool, thread stack size. Should I maybe use these fields instead? I believe you should leave thread stack size alone. But the memory pool parameters may be the same as the -Xms/-Xmx settings. Really, I just don't know, I just suspect. Maybe someone else can confirm. And finally, when nothing is specified here, what are the defaults? I have tried to find out by looking into some log files but havent found anything. You should browse the pages I mentioned below to make sure. It's in there somewhere (and these documents are very informative). I think I remember that the default varies according to the platform, and according to whether the JVM is started in server or client mode (if that still makes a difference with the 1.6 JVM). And I also think that it is either 64 or 128 MB. Anyway, 256 MB is higher than the default. --- On Tue, 3/9/10, André Warnier a...@ice-sa.com wrote: From: André Warnier a...@ice-sa.com Subject: Re: Memory settings To: Tomcat Users List users@tomcat.apache.org Date: Tuesday, March 9, 2010, 9:59 PM Mats Eklund wrote: Hi, I'm using Tomcat 5.5 on Windows and am sometimes experiencing exceptions thrown in my web application: java.lang.OutOfMemoryError: Java heap space. I will profile my application to see if this can be avoided by changing the code, however, I'm also interested to know whether and how memory available to the application can be configured. Short version : (Presuming you installed Tomcat using the service installer,) go to the Tomcat/bin directory and double-click the tomcat5w.exe program. This is a GUI allowing you, in one of the tabs, to set the JVM options used to run Java, which runs Tomcat. Use the options -Xms256m -Xmx256m for example to set the size of the Heap at start to 256 MB (-Xms) and maximum size 256 MB (-Xmx). Setting both to the same value is a bit more efficient, because it avoids the JVM having to keep track and resize this dynamically. Long version : http://java.sun.com/javase/technologies/hotspot/gc/index.jsp http://java.sun.com/javase/technologies/hotspot/gc/memorymanagement_whitepaper.pdf - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: Memory Settings in Tomcat 5.5.25
From: semaj2008 [mailto:[EMAIL PROTECTED] Subject: RE: Memory Settings in Tomcat 5.5.25 1. How do we view the memory settings if the tomcat server is not installed as a service? If you're running Tomcat via the scripts, you can set heap limits via the JAVA_OPTS environment variable. JConsole is always available to monitor any running JVM. 2. How do we view the memory settings if we run the server within eclipse? No idea - not something I would ever consider doing. Eclipse plays too many games with the configuration and environment to be trusted. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Memory Settings in Tomcat 5.5.25
From: semaj.najraham [mailto:[EMAIL PROTECTED] Subject: Memory Settings in Tomcat 5.5.25 I am getting java.lang.OutOfMemoryError: PermGen space error in my application. http://wiki.apache.org/tomcat/FAQ/Memory I need to find what how much memory have been allocation for tomcat 5.5.25 server. Use jconsole to look at the state of the heap in a running Tomcat. I cannot do Properties - Configure in sys tray to configure jvm memory options. Run the bin\tomcat5w.exe program to access the heap settings. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Memory Settings in Tomcat 5.5.25
Chuck, I am able to view the memory settings with tomcat5w.exe as you've said. few more questions: 1. How do we view the memory settings if the tomcat server is not installed as a service? 2. How do we view the memory settings if we run the server within eclipse? Thanks, Semaj Caldarale, Charles R wrote: From: semaj.najraham [mailto:[EMAIL PROTECTED] Subject: Memory Settings in Tomcat 5.5.25 I am getting java.lang.OutOfMemoryError: PermGen space error in my application. http://wiki.apache.org/tomcat/FAQ/Memory I need to find what how much memory have been allocation for tomcat 5.5.25 server. Use jconsole to look at the state of the heap in a running Tomcat. I cannot do Properties - Configure in sys tray to configure jvm memory options. Run the bin\tomcat5w.exe program to access the heap settings. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Memory-Settings-in-Tomcat-5.5.25-tp17679745p17684319.html Sent from the Tomcat - User mailing list archive at Nabble.com. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]