RE: Tomcat memory leak error launching web app in NetBeans 6.9.1
From: Martin O'Shea [mailto:app...@dsl.pipex.com] Subject: Tomcat memory leak error launching web app in NetBeans 6.9.1 16-Oct-2010 12:20:18 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads SEVERE: A web application appears to have started a thread named [DefaultQuartzScheduler_Worker-1] but has failed to stop it. This is very likely to create a memory leak. The above message is displayed when a webapp is *stopped*, not started (including Tomcat shutdown). I don't know if it is a problem with Tomcat or Quartz so any help is welcome Neither - it's an error in your webapp due to its failure to manage resources that it is using. If your webapp starts a thread, your webapp must be prepared to stop the thread during shutdown. This is usually accomplished by configuring and implementing a ServletContextListener in your webapp. - 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: Tomcat memory leak error launching web app in NetBeans 6.9.1
On 16 Oct 2010, at 12:45, Martin O'Shea app...@dsl.pipex.com wrote: Hello I wonder if anyone can help here? I am developing a web application written in Java servlets and JSPs which uses Quartz 1.6.1 to submit two jobs when Apache Tomcat 6.0.26 is started and hourly after that. But what I'm finding is that a message is issued several times as the server is started in NetBeans 6.9.1. The message is: 16-Oct-2010 12:20:18 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads SEVERE: A web application appears to have started a thread named [DefaultQuartzScheduler_Worker-1] but has failed to stop it. This is very likely to create a memory leak. Yes. So, umm, your webapp uses quartz - which is starting threads and not stopping them. Has anyone any idea? It seems to be causing Tomcat to stop every so often requiring a PC reboot. And I've found very little about this so far. The error message is issued by Tomcat when an app is stopped and it finds resources that haven't been properly terminated. The message itself is doesn't cause a leak, the source of the problem might - as the message itself states. I don't know if it is a problem with Tomcat or Quartz so any help is welcome Quartz, or the way you've configured it. p Thanks Martin O'Shea. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: Tomcat memory leak error launching web app in NetBeans 6.9.1
OK. So the error is happening as the application is closed, not as it started. My mistake. But Tomcat restarts occur frequently as I have NetBeans's Deploy on Save set. This seems to restart the server with the current objects. But what I don't understand is why the ServletContextListener which handles Quartz jobs should be going wrong? It is set to start and stop Quartz at contextInitialized and contextDestroyed times where the former creates an instance of a SchedulerController class which submits the two jobs. This problem never appeared to happen under NetBeans 6.9 with an earlier version of Tomcat which I was using recently. And I wonder if this may have anything to do with the Tomcat out of memory messages I've been receiving? Do I need to increase the memory allocated to the JVM for Tomcat at all? -Original Message- From: Pid * [mailto:p...@pidster.com] Sent: 16 Oct 2010 15 06 To: Tomcat Users List Subject: Re: Tomcat memory leak error launching web app in NetBeans 6.9.1 On 16 Oct 2010, at 12:45, Martin O'Shea app...@dsl.pipex.com wrote: Hello I wonder if anyone can help here? I am developing a web application written in Java servlets and JSPs which uses Quartz 1.6.1 to submit two jobs when Apache Tomcat 6.0.26 is started and hourly after that. But what I'm finding is that a message is issued several times as the server is started in NetBeans 6.9.1. The message is: 16-Oct-2010 12:20:18 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads SEVERE: A web application appears to have started a thread named [DefaultQuartzScheduler_Worker-1] but has failed to stop it. This is very likely to create a memory leak. Yes. So, umm, your webapp uses quartz - which is starting threads and not stopping them. Has anyone any idea? It seems to be causing Tomcat to stop every so often requiring a PC reboot. And I've found very little about this so far. The error message is issued by Tomcat when an app is stopped and it finds resources that haven't been properly terminated. The message itself is doesn't cause a leak, the source of the problem might - as the message itself states. I don't know if it is a problem with Tomcat or Quartz so any help is welcome Quartz, or the way you've configured it. p Thanks Martin O'Shea. - 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: Tomcat memory leak error launching web app in NetBeans 6.9.1
From: Martin O'Shea [mailto:app...@dsl.pipex.com] Subject: RE: Tomcat memory leak error launching web app in NetBeans 6.9.1 I have NetBeans's Deploy on Save set. This seems to restart the server with the current objects. No, it restarts the webapp, not the server. But what I don't understand is why the ServletContextListener which handles Quartz jobs should be going wrong? Time to add some debugging info to it and find out. Is your ServletContextListener even being called? Are you really running the configuration you think you are? (IDEs tend to obfuscate the situation, which is why a lot of us will not attempt to run Tomcat under an IDE.) And I wonder if this may have anything to do with the Tomcat out of memory messages I've been receiving? Sounds like a separate topic for a separate thread. - 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.
RE: Tomcat memory leak error launching web app in NetBeans 6.9.1
I know that the ServletContextListener is running when the application starts because of messages issued from it. It is also calling the two Quartz jobs which appear to be running normally as well. When the application is terminated, e.g. when the server is stopped, appropriate messages are issued to confirm that the scheduler has stopped. Then come the messages about the memory leak. And the configuration is the only one on this PC, Tomcat 6.0.26 using JVM 1.6.0_21-b07. I'm using JDK 1.6.0_21. -Original Message- From: Caldarale, Charles R [mailto:chuck.caldar...@unisys.com] Sent: 16 Oct 2010 15 30 To: Tomcat Users List Subject: RE: Tomcat memory leak error launching web app in NetBeans 6.9.1 From: Martin O'Shea [mailto:app...@dsl.pipex.com] Subject: RE: Tomcat memory leak error launching web app in NetBeans 6.9.1 I have NetBeans's Deploy on Save set. This seems to restart the server with the current objects. No, it restarts the webapp, not the server. But what I don't understand is why the ServletContextListener which handles Quartz jobs should be going wrong? Time to add some debugging info to it and find out. Is your ServletContextListener even being called? Are you really running the configuration you think you are? (IDEs tend to obfuscate the situation, which is why a lot of us will not attempt to run Tomcat under an IDE.) And I wonder if this may have anything to do with the Tomcat out of memory messages I've been receiving? Sounds like a separate topic for a separate thread. - 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: Tomcat memory leak error launching web app in NetBeans 6.9.1
From: Martin O'Shea [mailto:app...@dsl.pipex.com] Subject: RE: Tomcat memory leak error launching web app in NetBeans 6.9.1 When the application is terminated, e.g. when the server is stopped, appropriate messages are issued to confirm that the scheduler has stopped. What about when it's just the webapp being stopped, not the whole server? Try stopping just the webapp, then take a thread dump of Tomcat to see if the quartz threads are really still there. If they are, then the shutdown logic in the listener isn't working. And the configuration is the only one on this PC, Tomcat 6.0.26 using JVM 1.6.0_21-b07. I'm using JDK 1.6.0_21. IDEs have a nasty habit of substituting their own Tomcat and webapp configurations rather than using the ones you think you've set up. You won't find additional Tomcat or JDK installations, just behavior that's not consistent with what you configured. - 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.
RE: Tomcat memory leak error launching web app in NetBeans 6.9.1
Definitely seems to be when the web application in question is terminated, rather than Tomcat itself. And all indications are the listener that handles the scheduler. And I've tried another similar application which gives messages of the same kind. And yet both apps have worked under other environments. -Original Message- From: Caldarale, Charles R [mailto:chuck.caldar...@unisys.com] Sent: 16 Oct 2010 15 53 To: Tomcat Users List Subject: RE: Tomcat memory leak error launching web app in NetBeans 6.9.1 From: Martin O'Shea [mailto:app...@dsl.pipex.com] Subject: RE: Tomcat memory leak error launching web app in NetBeans 6.9.1 When the application is terminated, e.g. when the server is stopped, appropriate messages are issued to confirm that the scheduler has stopped. What about when it's just the webapp being stopped, not the whole server? Try stopping just the webapp, then take a thread dump of Tomcat to see if the quartz threads are really still there. If they are, then the shutdown logic in the listener isn't working. And the configuration is the only one on this PC, Tomcat 6.0.26 using JVM 1.6.0_21-b07. I'm using JDK 1.6.0_21. IDEs have a nasty habit of substituting their own Tomcat and webapp configurations rather than using the ones you think you've set up. You won't find additional Tomcat or JDK installations, just behavior that's not consistent with what you configured. - 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: Tomcat memory leak error launching web app in NetBeans 6.9.1
On 16/10/2010 15:24, Martin O'Shea wrote: OK. So the error is happening as the application is closed, not as it started. My mistake. But Tomcat restarts occur frequently as I have NetBeans's Deploy on Save set. This seems to restart the server with the current objects. But what I don't understand is why the ServletContextListener which handles Quartz jobs should be going wrong? It is set to start and stop Quartz at contextInitialized and contextDestroyed times where the former creates an instance of a SchedulerController class which submits the two jobs. Is the Quartz lib the latest version? This problem never appeared to happen under NetBeans 6.9 with an earlier version of Tomcat which I was using recently. The memory leak detection was released in 6.0.24. So the problem might have existed, you just might not have known about it. And I wonder if this may have anything to do with the Tomcat out of memory messages I've been receiving? Do I need to increase the memory allocated to the JVM for Tomcat at all? Some of the detection just results in a log message, some of it results in a message and an attempt to clean up. p -Original Message- From: Pid * [mailto:p...@pidster.com] Sent: 16 Oct 2010 15 06 To: Tomcat Users List Subject: Re: Tomcat memory leak error launching web app in NetBeans 6.9.1 On 16 Oct 2010, at 12:45, Martin O'Shea app...@dsl.pipex.com wrote: Hello I wonder if anyone can help here? I am developing a web application written in Java servlets and JSPs which uses Quartz 1.6.1 to submit two jobs when Apache Tomcat 6.0.26 is started and hourly after that. But what I'm finding is that a message is issued several times as the server is started in NetBeans 6.9.1. The message is: 16-Oct-2010 12:20:18 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads SEVERE: A web application appears to have started a thread named [DefaultQuartzScheduler_Worker-1] but has failed to stop it. This is very likely to create a memory leak. Yes. So, umm, your webapp uses quartz - which is starting threads and not stopping them. Has anyone any idea? It seems to be causing Tomcat to stop every so often requiring a PC reboot. And I've found very little about this so far. The error message is issued by Tomcat when an app is stopped and it finds resources that haven't been properly terminated. The message itself is doesn't cause a leak, the source of the problem might - as the message itself states. I don't know if it is a problem with Tomcat or Quartz so any help is welcome Quartz, or the way you've configured it. p Thanks Martin O'Shea. - 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 0x62590808.asc Description: application/pgp-keys signature.asc Description: OpenPGP digital signature
RE: Tomcat memory leak error launching web app in NetBeans 6.9.1
This answers a few questions. I thought also that I had the most recent version of Quartz running but I only have version 1.6.1. They are up to 1.8.3 so I will try this out. Thanks. -Original Message- From: Pid [mailto:p...@pidster.com] Sent: 16 Oct 2010 17 33 To: Tomcat Users List Subject: Re: Tomcat memory leak error launching web app in NetBeans 6.9.1 On 16/10/2010 15:24, Martin O'Shea wrote: OK. So the error is happening as the application is closed, not as it started. My mistake. But Tomcat restarts occur frequently as I have NetBeans's Deploy on Save set. This seems to restart the server with the current objects. But what I don't understand is why the ServletContextListener which handles Quartz jobs should be going wrong? It is set to start and stop Quartz at contextInitialized and contextDestroyed times where the former creates an instance of a SchedulerController class which submits the two jobs. Is the Quartz lib the latest version? This problem never appeared to happen under NetBeans 6.9 with an earlier version of Tomcat which I was using recently. The memory leak detection was released in 6.0.24. So the problem might have existed, you just might not have known about it. And I wonder if this may have anything to do with the Tomcat out of memory messages I've been receiving? Do I need to increase the memory allocated to the JVM for Tomcat at all? Some of the detection just results in a log message, some of it results in a message and an attempt to clean up. p -Original Message- From: Pid * [mailto:p...@pidster.com] Sent: 16 Oct 2010 15 06 To: Tomcat Users List Subject: Re: Tomcat memory leak error launching web app in NetBeans 6.9.1 On 16 Oct 2010, at 12:45, Martin O'Shea app...@dsl.pipex.com wrote: Hello I wonder if anyone can help here? I am developing a web application written in Java servlets and JSPs which uses Quartz 1.6.1 to submit two jobs when Apache Tomcat 6.0.26 is started and hourly after that. But what I'm finding is that a message is issued several times as the server is started in NetBeans 6.9.1. The message is: 16-Oct-2010 12:20:18 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads SEVERE: A web application appears to have started a thread named [DefaultQuartzScheduler_Worker-1] but has failed to stop it. This is very likely to create a memory leak. Yes. So, umm, your webapp uses quartz - which is starting threads and not stopping them. Has anyone any idea? It seems to be causing Tomcat to stop every so often requiring a PC reboot. And I've found very little about this so far. The error message is issued by Tomcat when an app is stopped and it finds resources that haven't been properly terminated. The message itself is doesn't cause a leak, the source of the problem might - as the message itself states. I don't know if it is a problem with Tomcat or Quartz so any help is welcome Quartz, or the way you've configured it. p Thanks Martin O'Shea. - 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 - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Showing Tomcat Memory Utilization with 'top'
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Chuck, On 6/22/2010 5:00 PM, Caldarale, Charles R wrote: From: Christopher Schultz [mailto:ch...@christopherschultz.net] Subject: Re: Showing Tomcat Memory Utilization with 'top' Also, I believe VIRT includes memory shared with other processes Doesn't RES also include shared pages - anything that's in the memory map of the process? (I can't remember exactly how that works, but the shared pages have to be accounted for somewhere.) This is reaching the limits of my knowledge as well. I could imagine shared memory not being counted against every process but it also quite makes sense that it would. so if you have 50MiB of Java system classes loaded and a modern JVM which shares them among running JVMs Note that only the client HotSpot JVM shares classes; the server version does not. (The sharing is really class templates, not the class objects themselves.) I didn't realize that the server JVM didn't share class templates. Do you have any ideas why not? It seems to be a relatively cheap optimization when multiple JVMs are in use, and shouldn't include too much overhead for either the process or the OS if there's no actual sharing going on in a single-JVM scenario. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkwiPcQACgkQ9CaO5/Lv0PA9oACcCAVoKQZ3F9DG5iPmEusC0nSt k/wAnjfHzZpGU2lceqY7cltkJ/EUiNk9 =sw+t -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: Showing Tomcat Memory Utilization with 'top'
From: Christopher Schultz [mailto:ch...@christopherschultz.net] Subject: Re: Showing Tomcat Memory Utilization with 'top' I didn't realize that the server JVM didn't share class templates. Do you have any ideas why not? AFAIK, Sun just hadn't gotten around to it yet; don't know if it's in JRE 7 or not. Class sharing is primarily of interest in environments where startup time is critical, and Sun didn't think that the server JVM would be subject to that issue. However, with more and more 64-bit environments being available (eg, everybody's laptops) that have only a server JVM on them, that decision looks like it's no longer valid. Note that the client and server JVMs are really two entirely different beasts, so the data structures from one are not easily translated to the other. - 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.
Showing Tomcat Memory Utilization with 'top'
In top, my java processes all show an average VIRT size of about 250MB and an average RES size of about 150MB. Most of them were started with a 64MB heap size. I have two questions: 1. Top shows 0k of swap usage, so the system is not swapping. In that case, why is there a difference between the VIRT and RES numbers? My understanding is that RES=CODE+DATA and VIRT=RES+SWAP. If swap=0, then should not RES and VIRT be the same? 2. Where does the 64MB of java heap show up? -- Eric Robinson Disclaimer - June 22, 2010 This email and any files transmitted with it are confidential and intended solely for Tomcat Users List. If you are not the named addressee you should not disseminate, distribute, copy or alter this email. Any views or opinions presented in this email are solely those of the author and might not represent those of . Warning: Although has taken reasonable precautions to ensure no viruses are present in this email, the company cannot accept responsibility for any loss or damage arising from the use of this email or attachments. This disclaimer was added by Policy Patrol: http://www.policypatrol.com/ - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: Showing Tomcat Memory Utilization with 'top'
From: Robinson, Eric [mailto:eric.robin...@psmnv.com] Subject: Showing Tomcat Memory Utilization with 'top' 1. Top shows 0k of swap usage, so the system is not swapping. In that case, why is there a difference between the VIRT and RES numbers? Linux always allocates more virtual space than is actually used (thread stack space, for example). The JVM will also reserve, but not commit, the -Xmx size of the heap (and other spaces); it only commits what is really needed. My understanding is that RES=CODE+DATA and VIRT=RES+SWAP. Nope. RES is real memory usage, VIRT is just whatever space has been allocated, but not necessarily touched. Until a page is touched, it won't exist in RAM or on the swap file. 2. Where does the 64MB of java heap show up? Buried inside the VIRT number. - 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: Showing Tomcat Memory Utilization with 'top'
2. Where does the 64MB of java heap show up? Buried inside the VIRT number. For example, I have a tomcat configured to use 96MB of heap (export JAVA_OPTS=-ms96M -mx96M). Top shows VIRT=336396, RES=227264. I'm guessing that the 96MB of heap is buried in BOTH the VIRT and RES numbers? -- Eric Robinson Disclaimer - June 22, 2010 This email and any files transmitted with it are confidential and intended solely for Tomcat Users List. If you are not the named addressee you should not disseminate, distribute, copy or alter this email. Any views or opinions presented in this email are solely those of the author and might not represent those of . Warning: Although has taken reasonable precautions to ensure no viruses are present in this email, the company cannot accept responsibility for any loss or damage arising from the use of this email or attachments. This disclaimer was added by Policy Patrol: http://www.policypatrol.com/ - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: Showing Tomcat Memory Utilization with 'top'
From: Robinson, Eric [mailto:eric.robin...@psmnv.com] Subject: RE: Showing Tomcat Memory Utilization with 'top' For example, I have a tomcat configured to use 96MB of heap (export JAVA_OPTS=-ms96M -mx96M). Top shows VIRT=336396, RES=227264. I'm guessing that the 96MB of heap is buried in BOTH the VIRT and RES numbers? Since -Xms == -Xmx, that is normally true. However, the JVM may not have actually used all the allocated heap space, since the heap is internally divided into several regions (eg, eden, survivor, tenured), and some of these are further subdivided (TLAB). If a page in the heap hasn't been touched (not unusual for some TLAB areas), it will appear in VIRT but not in RES. - 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: Showing Tomcat Memory Utilization with 'top'
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Chuck, On 6/22/2010 3:22 PM, Caldarale, Charles R wrote: From: Robinson, Eric [mailto:eric.robin...@psmnv.com] Subject: Showing Tomcat Memory Utilization with 'top' 1. Top shows 0k of swap usage, so the system is not swapping. In that case, why is there a difference between the VIRT and RES numbers? Linux always allocates more virtual space than is actually used (thread stack space, for example). The JVM will also reserve, but not commit, the -Xmx size of the heap (and other spaces); it only commits what is really needed. My understanding is that RES=CODE+DATA and VIRT=RES+SWAP. Nope. RES is real memory usage, VIRT is just whatever space has been allocated, but not necessarily touched. Until a page is touched, it won't exist in RAM or on the swap file. Also, I believe VIRT includes memory shared with other processes, so if you have 50MiB of Java system classes loaded and a modern JVM which shares them among running JVMs, then you'll see that 50MiB included in every process's VIRT that is sharing it, which is somewhat misleading. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkwhGo0ACgkQ9CaO5/Lv0PCUlwCgmkijMJ5TQN6sMlDAboPU9upV cQEAoI7ZWJaD1hIFsYmx89WnFRjM4dkv =lN9a -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: Showing Tomcat Memory Utilization with 'top'
Also, I believe VIRT includes memory shared with other processes, so if you have 50MiB of Java system classes loaded and a modern JVM which shares them among running JVMs, then you'll see that 50MiB included in every process's VIRT that is sharing it, which is somewhat misleading. Excellent point. 'top' shows 30-40MB in the 'SHR' column for each java process. Is that what you're referring to? -- Eric Robinson Disclaimer - June 22, 2010 This email and any files transmitted with it are confidential and intended solely for Tomcat Users List,Caldarale, Charles R. If you are not the named addressee you should not disseminate, distribute, copy or alter this email. Any views or opinions presented in this email are solely those of the author and might not represent those of . Warning: Although has taken reasonable precautions to ensure no viruses are present in this email, the company cannot accept responsibility for any loss or damage arising from the use of this email or attachments. This disclaimer was added by Policy Patrol: http://www.policypatrol.com/ - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: Showing Tomcat Memory Utilization with 'top'
From: Christopher Schultz [mailto:ch...@christopherschultz.net] Subject: Re: Showing Tomcat Memory Utilization with 'top' Also, I believe VIRT includes memory shared with other processes Doesn't RES also include shared pages - anything that's in the memory map of the process? (I can't remember exactly how that works, but the shared pages have to be accounted for somewhere.) so if you have 50MiB of Java system classes loaded and a modern JVM which shares them among running JVMs Note that only the client HotSpot JVM shares classes; the server version does not. (The sharing is really class templates, not the class objects themselves.) - 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.
RE: Showing Tomcat Memory Utilization with 'top'
From: Robinson, Eric [mailto:eric.robin...@psmnv.com] Subject: RE: Showing Tomcat Memory Utilization with 'top' 'top' shows 30-40MB in the 'SHR' column for each java process. Is that what you're referring to? That could be any memory (eg, file pages) that's being used in more than one process. - 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: tomcat memory question
,57344,57536,6824.4,0,234432,43051.1,699072,56547.9,86016,84826.9,4554,41.42,140,41.189,82.609 5:27 PM,40384,39552,0,0,241472,9214.1,698048,56042.8,86016,85068.4,4569,41.654,142,41.733,83.387 5:28 PM,33856,34880,0,0,246144,142425.9,699072,72538.1,86016,85050.2,4584,41.858,144,42.29,84.148 5:29 PM,34624,35840,0,0,246912,0,699072,75336.9,86016,86015.9,4600,42.124,146,42.579,84.703 5:30 PM,30528,29696,0,0,251712,8659.2,695168,55628,86016,84960.3,4619,42.419,148,43.386,85.804 5:31 PM,54976,56896,0,0,235712,46460.7,699072,55692.1,86016,84808.4,4638,43.443,150,43.882,87.324 5:32 PM,34240,34432,0,21864.2,244608,0,699072,58492.1,86016,86015.9,4659,43.833,151,43.882,87.715 5:32 PM,34240,35776,0,0,245632,218408.9,699072,70700.8,86016,85191,4660,43.837,152,44.406,88.242 5:33 PM,38528,40320,0,0,248256,2285.5,695808,55692,86016,85211,4676,44.181,154,44.935,89.116 5:34 PM,32896,34176,0,0,252800,39141,696256,56017.4,86016,85089.1,4694,44.492,156,45.527,90.018 5:35 PM,30528,31744,0,0,257792,7705.7,696320,55393.1,86016,84869,4718,44.881,158,46.092,90.973 5:36 PM,31616,32640,0,0,259200,769.5,695552,55291,86016,84766.7,4736,45.171,160,46.649,91.82 5:38 PM,31296,32576,0,0,264320,8005.1,696512,55448.5,86016,85074.6,4766,45.689,162,47.198,92.887 5:46 PM,34048,6848,0,6848,282176,0,696512,99912.5,86016,86015.9,4873,47.811,163,47.198,95.009 5:46 PM,34048,35456,0,0,278592,3379.3,696576,55326.5,86016,84954.3,4874,47.814,164,47.796,95.61 5:54 PM,31488,30336,0,0,286144,237399.7,696768,55451.5,86016,85142.3,4987,49.961,166,48.324,98.285 6:02 PM,32192,30848,0,0,274368,5980.1,696640,55332.1,86016,85108.1,5103,52.314,168,48.916,101.23 6:09 PM,38144,64,0,0,276416,15814.6,697536,56164.9,86016,85325.8,5159,53.572,170,49.522,103.094 6:11 PM,34752,33536,0,0,275456,5206.4,697280,56571.9,86016,85075.4,5167,53.733,172,50.078,103.812 CSV data end - Original Message - From: Jeffrey Janner jeffrey.jan...@polydyne.com To: Tomcat Users List users@tomcat.apache.org Sent: Friday, May 28, 2010 1:26 AM Subject: RE: tomcat memory question -Original Message- From: Christopher Schultz [mailto:ch...@christopherschultz.net] Sent: Thursday, May 27, 2010 9:40 AM To: Tomcat Users List Subject: Re: tomcat memory question -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 塗, On 5/27/2010 4:51 AM, 塗 wrote: there is a problem with my webapp. web operating environment: tomcat5.5.27 + Apache/2.2.3 + jdk1.5.0_13 + Linux_x86_64 [below] is my manual configurations for tomcat JVM: CATALINA_OPTS=-Xms1024M -Xmx1024M -Dorg.apache.jasper.compiler.Parser.STRICT_QUOTE_ESCAPING=false Are you using a 64-bit or 32-bit JVM? When my webapp is started, I use the jvm's own tools(jstat) to trace the garbage collections. Ok. the Utilization rate of the PC capacity is always 100%. is it normal? What is PC (sorry, the jstat man page sucks)? What is the command you used to produce your jstat output? Well, PC is apparently Permanent Capacity in KB, and PU is the current Permanent Utilization (not to be confused with PermGen apparently). Taking his data a sticking it in a spreadsheet (to make it readable) shows that PC is increasing and keeping slightly ahead of PU. I'd say nothing to worry about unless PC is starting to reach PGCMX (which is? Try including the -gccapacity option). Looks like normal GC at work to me. Firstly the 1 Full GC is occurrenced within 1 hour, 5 hours later that took place within 1 hour 100 Full GC. is it normal? Can you clarify this last statement? When did the first full GC take place? When did the second? When did the third? Are you saying that you get one full GC in one hour, then 5 hours for the second, then 100 full GCs all close together? The OPs original statement makes no sense in light of the data give. There is no Full GC count line in his data (though doc says there should be: http://java.sun.com/j2se/1.5.0/docs/tooldocs/share/jstat.html). The doc seems to imply that the GC times should be cumulative from start, so it looks like he's done some Full GC between each sample taken (about 7 secs/hr.) It would be really helpful if he had listed his jstat options. All the actual capacity/utilization numbers appear to be rising and falling over time in apparent relation to normal usage. The permanent util number doesn't seem to drop often, so he may have a memory leak. (I'd seek the opinion of someone more versed than me in reading jstat output though.) It would have been useful if he had a specific issue he was having and trying to resolve. That suggests to me that your webapp is allocating memory and never releasing it. This could be due to many reasons such as a memory leak (which ought to be fixed) or caching (which may be working as designed). Is your webapp performing well? GC activity doesn't necessarily mean that anything is wrong. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http
Re: tomcat memory question
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 塗, On 5/28/2010 3:11 AM, sesfei wrote: Are you using a 64-bit or 32-bit JVM? yes, that is 64-bit JVM. With such a modest heap (1GiB), you might consider running a 32-bit JVM: you might even get better heap performance with smaller pointers. [root]# jstat -gc {tomcat pid} 3000 [snip] PC Current permanent space capacity (KB). Ok. Can you clarify this last statement? When did the first full GC take place? When did the second? When did the third? According to the following csv data, we can see full-gc occurred at a time like this. The 1st full-gc tomcat takes place at tomcat is starting. The 2th full-gc tomcat takes place at 11:48AM The 3th full-gc tomcat takes place at 1:23 PM The 4th full-gc tomcat takes place at 2:49 PM The 5th full-gc tomcat takes place at 4:24 PM The 6th full-gc tomcat takes place at 4:33 PM After 7th full-gc , basically 1 full-gc at 1 minutes will be occurred. is it normal? Is it because the programm of webapp not well, leading to memory leak? Full GCs happen either when memory is tight or just whenever the GC feels like running. Typically, you'll have a lot of small GCs over a long (relatively speaking) period of time, and then a full GC once and a while. Check may (will?) correct me on this, but I believe a full GC might be necessary to clear-out certain resources such as completed Threads or other things that have concrete OS-level counterparts. If you are using a lot of (non-pooled) threads or socket connections, the JVM may be performing full GCs to clean up those resources. Frequent full GCs might just mean that you are using a lot of your memory. As long as you don't get any OutOfMemoryErrors, it appears that your heap is adequate for the load you're experiencing. Frequent full GCs could be seen as a symptom of having a heap that is just a little too small for your needs: everything you're doing fits in the heap, but in order to stay running, full GC are needed frequently. Try increasing your heap size by 20% and see if the full GCs happen less frequently. Again, as long as you're not running out of memory, you webapp is probably doing just fine. More breathing room in the heap certainly couldn't hurt. Good luck, - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkv/y/cACgkQ9CaO5/Lv0PCQuwCgkcA4H1maoUrHucWRKO3PG6aC PYsAn0Az7dMicym9vDEg6uTJC1gMLILz =mWk9 -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: tomcat memory question
From: Christopher Schultz [mailto:ch...@christopherschultz.net] Subject: Re: tomcat memory question Check may (will?) correct me on this -1 for spelling I believe a full GC might be necessary to clear-out certain resources such as completed Threads or other things that have concrete OS-level counterparts. Not exactly; a full GC is necessary to clear out dead classes and any objects that have migrated into the tenured generation. The OS-level thread structures are gone as soon as the java.lang.Thread instance stops running (returns from the run() method), while the Java instance will hang around as long as there are references to it. Some OS resources will stay allocated until a GC happens *if* the program fails to explicitly close them before the corresponding Java object becomes unreachable (aka sloppy programming), but any kind of GC that discovers such a dead object will release the associated native resources. If you are using a lot of (non-pooled) threads or socket connections, the JVM may be performing full GCs to clean up those resources. GC itself knows nothing about the relationship between Java objects and external resources; only the finalizer for such a class does. Frequent full GCs might just mean that you are using a lot of your memory. As long as you don't get any OutOfMemoryErrors, it appears that your heap is adequate for the load you're experiencing. Assuming there are no memory leaks, it's an indication that the heap is undersized for the application, or that the application is behaving in an unexpected fashion with regard to expected object creation patterns. (An application that creates only long-lived objects, for example - but that's really hard to believe that could happen in a servlet container.) - 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.
Re: tomcat memory question
On 28.05.2010 16:26, Caldarale, Charles R wrote: From: Christopher Schultz [mailto:ch...@christopherschultz.net] Subject: Re: tomcat memory question Check may (will?) correct me on this -1 for spelling I believe a full GC might be necessary to clear-out certain resources such as completed Threads or other things that have concrete OS-level counterparts. Not exactly; a full GC is necessary to clear out dead classes and any objects that have migrated into the tenured generation. The OS-level thread structures are gone as soon as the java.lang.Thread instance stops running (returns from the run() method), while the Java instance will hang around as long as there are references to it. Some OS resources will stay allocated until a GC happens *if* the program fails to explicitly close them before the corresponding Java object becomes unreachable (aka sloppy programming), but any kind of GC that discovers such a dead object will release the associated native resources. If you are using a lot of (non-pooled) threads or socket connections, the JVM may be performing full GCs to clean up those resources. GC itself knows nothing about the relationship between Java objects and external resources; only the finalizer for such a class does. Frequent full GCs might just mean that you are using a lot of your memory. As long as you don't get any OutOfMemoryErrors, it appears that your heap is adequate for the load you're experiencing. Assuming there are no memory leaks, it's an indication that the heap is undersized for the application, or that the application is behaving in an unexpected fashion with regard to expected object creation patterns. (An application that creates only long-lived objects, for example - but that's really hard to believe that could happen in a servlet container.) There's a couple of options. We can't decide, because we only see partial data (and none of GC logging, which is much more helpful when enabled correctly): - distributed GC because of RMI. That would fit the once per minute Full GC. But the data presented looks like it's not once per minute, but about once to twice per minute. - full gc triggered by class unloading: but perm doesn't seem to be close to some magic size. - lots of allocation flooding the semi spaces and flowing over into tenured. Did you give us only the jstat lines, which happened after the increase of the FGC counter? The used capacity of tenured (OU/OC) seems to be very small in all lines given, which would be normal and hide the GC reason, if you had thrown away all data lines immediately before a FGC. The same for Perm and class unloading. Regards, Rainer - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
tomcat memory question
hi, all there is a problem with my webapp. by manual configuration, i allocated 1G(1024M) memory for webapp. where the gc new capacity automatically is 262M, the gc old capacity automatically is 699M, S0/S1 automatically is 43.6M/43.6M., PC automatically is 42M When my webapp is started, I use the jvm's own tools(jstat) to trace the garbage collections. the Utilization rate of the PC capacity is always 100%. is it normal? Firstly the 1 Full GC is occurrenced within 1 hour, 5 hours later that took place within 1 hour 100 Full GC. is it normal? [web operating environment:] tomcat5.5.27 + Apache/2.2.3 + jdk1.5.0_13 + Linux_x86_64 [blow is my manual configurations for tomcat JVM:] CATALINA_OPTS=-Xms1024M -Xmx1024M -Dorg.apache.jasper.compiler.Parser.STRICT_QUOTE_ESCAPING=false [Jstat Tracking data (csv data)] systime, S0C, S1C, S0U, S1U, EC, EU, OC, OU, PC, PU, YGC, YGCT, FGCT, GCT 11:13:41, 9600, 3392, 0, 3369.3, 53568, 36562.3, 699072, 481787.7, 61184, 61167, 249, 3.148, 0.005, 3.153 11:48:02, 4032, 3520, 0, 3520, 39616, 0, 699072, 697526, 67712, 67573.5, 385, 4.849, 0.005, 4.854 13:23:53, 2496, 2496, 0, 0, 29568, 5620.2, 699072, 100281.5, 71360, 71236.5, 1003, 10.057, 3.48, 13.537 14:49:13, 2624, 2624, 0, 0, 27712, 12302, 679936, 74349.4, 78080, 71771.3, 1898, 15.979, 3.962, 19.941 16:07:54, 3392, 3712, 1664, 0, 50496, 28601.3, 688000, 109525.6, 78080, 74945.2, 2804, 21.46, 4.567, 26.027 16:24:03, 4480, 2304, 0, 0, 77632, 27240.9, 656960, 103414.1, 78080, 75622.1, 3107, 23.191, 4.943, 28.134 16:33:39, 4160, 2304, 0, 0, 78144, 25196.7, 658752, 98731.2, 78080, 76421.6, 3365, 24.604, 5.329, 29.933 16:41:50, 5568, 3008, 0, 2952.4, 103424, 96055.6, 606976, 69788.7, 78080, 74229.1, 3591, 25.889, 5.742, 31.631 16:42:40, 7360, 10176, 0, 0, 174464, 0, 652544, 91210.1, 86016, 86010.7, 3620, 26.067, 6.081, 32.148 16:43:25, 19520, 19200, 0, 0, 179328, 12770.2, 681728, 55882.2, 86016, 84680.4, 3637, 26.329, 7.634, 33.963 16:44:22, 21376, 20608, 0, 0, 181504, 13683.9, 681600, 55718.4, 86016, 84905.3, 3653, 26.507, 8.276, 34.784 16:47:34, 22656, 23744, 17914.8, 0, 182656, 135109.5, 687232, 56195.2, 86016, 85854.9, 3710, 27.079, 9.954, 37.032 16:51:16, 23360, 24064, 0, 0, 183872, 6675.4, 695232, 56231, 86016, 84901.6, 3784, 27.828, 13.631, 41.459 16:53:46, 24768, 23808, 0, 18298.8, 191872, 161459.7, 695616, 56960.4, 86016, 85728.5, 3833, 28.605, 15.221, 43.826 16:57:43, 28800, 26944, 0, 21923, 200768, 5245.9, 699072, 66807, 86016, 85505, 3909, 29.494, 17.746, 47.24 17:02:02, 28608, 10752, 0, 10720, 205824, 118015.1, 696128, 56332.7, 86016, 85880.8, 3999, 30.492, 22.473, 52.965 17:03:57, 32384, 32448, 17668.8, 0, 209152, 64383, 699072, 65796.8, 86016, 85142.6, 4038, 31.049, 24.71, 55.759 17:09:19, 32256, 32576, 18938.8, 0, 224512, 43783.8, 699072, 73448.4, 86016, 84862.6, 4146, 32.986, 30.05, 63.035 17:12:59, 54208, 52608, 0, 36976.4, 224640, 76931.5, 699072, 63084.4, 86016, 85367, 4221, 34.258, 33.295, 67.553 17:16:21, 45632, 45760, 26864.6, 0, 224512, 158991.5, 699072, 60327, 86016, 85273.6, 4356, 37.225, 35.458, 72.683 17:24:47, 29120, 30016, 0, 14856.2, 274944, 103582.1, 697344, 57937.4, 86016, 85176.8, 4525, 40.282, 40.071, 80.352 17:33:57, 32832, 34688, 25448.2, 0, 250560, 19438.8, 695808, 55692, 86016, 85489.8, 4686, 44.335, 44.935, 89.27 17:44:33, 29952, 28672, 0, 22952.2, 280896, 175914.9, 696512, 85648.5, 86016, 85940.8, 4845, 47.238, 47.198, 94.436 thanks.. -- 2010 FIFA World Cup News [Yahoo!Sports/sportsnavi] http://pr.mail.yahoo.co.jp/southafrica2010/ - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: tomcat memory question
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 塗, On 5/27/2010 4:51 AM, 塗 wrote: there is a problem with my webapp. web operating environment: tomcat5.5.27 + Apache/2.2.3 + jdk1.5.0_13 + Linux_x86_64 [below] is my manual configurations for tomcat JVM: CATALINA_OPTS=-Xms1024M -Xmx1024M -Dorg.apache.jasper.compiler.Parser.STRICT_QUOTE_ESCAPING=false Are you using a 64-bit or 32-bit JVM? When my webapp is started, I use the jvm's own tools(jstat) to trace the garbage collections. Ok. the Utilization rate of the PC capacity is always 100%. is it normal? What is PC (sorry, the jstat man page sucks)? What is the command you used to produce your jstat output? Firstly the 1 Full GC is occurrenced within 1 hour, 5 hours later that took place within 1 hour 100 Full GC. is it normal? Can you clarify this last statement? When did the first full GC take place? When did the second? When did the third? Are you saying that you get one full GC in one hour, then 5 hours for the second, then 100 full GCs all close together? That suggests to me that your webapp is allocating memory and never releasing it. This could be due to many reasons such as a memory leak (which ought to be fixed) or caching (which may be working as designed). Is your webapp performing well? GC activity doesn't necessarily mean that anything is wrong. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkv+hFoACgkQ9CaO5/Lv0PBFkgCgvqoksV7PgaqGFOI5wCgXwaIa yKcAniKySqd3g8wd7paAoRBn0mWklSZY =RfE/ -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: tomcat memory question
On 27/05/2010 15:40, Christopher Schultz wrote: W, On 5/27/2010 4:51 AM, W wrote: there is a problem with my webapp. web operating environment: tomcat5.5.27 + Apache/2.2.3 + jdk1.5.0_13 + Linux_x86_64 [below] is my manual configurations for tomcat JVM: CATALINA_OPTS=-Xms1024M -Xmx1024M -Dorg.apache.jasper.compiler.Parser.STRICT_QUOTE_ESCAPING=false Are you using a 64-bit or 32-bit JVM? When my webapp is started, I use the jvm's own tools(jstat) to trace the garbage collections. Ok. the Utilization rate of the PC capacity is always 100%. is it normal? What is PC (sorry, the jstat man page sucks)? What is the command you used to produce your jstat output? I had to look it up too. http://java.sun.com/javase/6/docs/technotes/tools/share/jstat.html p Firstly the 1 Full GC is occurrenced within 1 hour, 5 hours later that took place within 1 hour 100 Full GC. is it normal? Can you clarify this last statement? When did the first full GC take place? When did the second? When did the third? Are you saying that you get one full GC in one hour, then 5 hours for the second, then 100 full GCs all close together? That suggests to me that your webapp is allocating memory and never releasing it. This could be due to many reasons such as a memory leak (which ought to be fixed) or caching (which may be working as designed). Is your webapp performing well? GC activity doesn't necessarily mean that anything is wrong. -chris - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org signature.asc Description: OpenPGP digital signature
RE: tomcat memory question
-Original Message- From: Christopher Schultz [mailto:ch...@christopherschultz.net] Sent: Thursday, May 27, 2010 9:40 AM To: Tomcat Users List Subject: Re: tomcat memory question -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 塗, On 5/27/2010 4:51 AM, 塗 wrote: there is a problem with my webapp. web operating environment: tomcat5.5.27 + Apache/2.2.3 + jdk1.5.0_13 + Linux_x86_64 [below] is my manual configurations for tomcat JVM: CATALINA_OPTS=-Xms1024M -Xmx1024M -Dorg.apache.jasper.compiler.Parser.STRICT_QUOTE_ESCAPING=false Are you using a 64-bit or 32-bit JVM? When my webapp is started, I use the jvm's own tools(jstat) to trace the garbage collections. Ok. the Utilization rate of the PC capacity is always 100%. is it normal? What is PC (sorry, the jstat man page sucks)? What is the command you used to produce your jstat output? Well, PC is apparently Permanent Capacity in KB, and PU is the current Permanent Utilization (not to be confused with PermGen apparently). Taking his data a sticking it in a spreadsheet (to make it readable) shows that PC is increasing and keeping slightly ahead of PU. I'd say nothing to worry about unless PC is starting to reach PGCMX (which is? Try including the -gccapacity option). Looks like normal GC at work to me. Firstly the 1 Full GC is occurrenced within 1 hour, 5 hours later that took place within 1 hour 100 Full GC. is it normal? Can you clarify this last statement? When did the first full GC take place? When did the second? When did the third? Are you saying that you get one full GC in one hour, then 5 hours for the second, then 100 full GCs all close together? The OPs original statement makes no sense in light of the data give. There is no Full GC count line in his data (though doc says there should be: http://java.sun.com/j2se/1.5.0/docs/tooldocs/share/jstat.html). The doc seems to imply that the GC times should be cumulative from start, so it looks like he's done some Full GC between each sample taken (about 7 secs/hr.) It would be really helpful if he had listed his jstat options. All the actual capacity/utilization numbers appear to be rising and falling over time in apparent relation to normal usage. The permanent util number doesn't seem to drop often, so he may have a memory leak. (I'd seek the opinion of someone more versed than me in reading jstat output though.) It would have been useful if he had a specific issue he was having and trying to resolve. That suggests to me that your webapp is allocating memory and never releasing it. This could be due to many reasons such as a memory leak (which ought to be fixed) or caching (which may be working as designed). Is your webapp performing well? GC activity doesn't necessarily mean that anything is wrong. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkv+hFoACgkQ9CaO5/Lv0PBFkgCgvqoksV7PgaqGFOI5wCgXwaIa yKcAniKySqd3g8wd7paAoRBn0mWklSZY =RfE/ -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org *** NOTICE * This message is intended for the use of the individual or entity to which it is addressed and may contain information that is privileged, confidential, and exempt from disclosure under applicable law. If the reader of this message is not the intended recipient or the employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution, or copying of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by reply or by telephone (call us collect at 512-343-9100) and immediately delete this message and all its attachments.
Re: tomcat memory usage
FYI - look out for this WRT MaxNewSize and NewRatio: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6862534 - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: tomcat memory usage
Dan, These are the Javs opts currently set in catalina.sh: JAVA_OPTS=-Xms512m -Xmx512m -XX:PermSize=384m -XX:MaxPermSize=384m -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/usr/local/tomcat/logs Do you see anything dangerous/wrong/not good? Thanks, Carl - Original Message - From: Dan Armbrust daniel.armbrust.l...@gmail.com To: Tomcat Users List users@tomcat.apache.org; p...@pidster.com Sent: Tuesday, February 02, 2010 2:07 PM Subject: Re: tomcat memory usage FYI - look out for this WRT MaxNewSize and NewRatio: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6862534 - 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: tomcat memory usage
Nope, but I'm not an expert with these (at all). I use something pretty similar, the only real difference is that I haven't turned on the CMSIncrementalMode. My apps haven't shown an issue with long pause times, so I haven't researched/tested it yet. Dan On Tue, Feb 2, 2010 at 1:55 PM, Carl c...@etrak-plus.com wrote: Dan, These are the Javs opts currently set in catalina.sh: JAVA_OPTS=-Xms512m -Xmx512m -XX:PermSize=384m -XX:MaxPermSize=384m -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/usr/local/tomcat/logs Do you see anything dangerous/wrong/not good? Thanks, Carl - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: tomcat memory usage
Chuck and Chris, Thanks for yor explanations, Let me, try to summarize what I understand adding some extra info and ask my questions. Is following classifications true for memory usage of Java ? If not please correct it. A. Java memory usage when application is started as a windows service: 1. Heap memory * objects 2. Non-heap memory * PermGen (holds reflective data (meta-data) of the JVM itself, such as class and method objects and static fields ) * JVM's itself ( Garbage collector, managing heap etc.) * Java service wrapper dlls. B. Java memory usage when application is with a batch file: 1. Heap memory * objects 2. Non-heap memory * PermGen (holds reflective data (meta-data) of the JVM itself, such as class and method objects and static fields ) * JVM's itself ( Garbage collector, managing heap etc.) If I turn my first e-mail, in my example, java heap size was 512 MB, I did'nt define PermSize parameter so application uses default value 64 MB. Sum of PermGen and Heap memory usage smalller then 600,980 KB which I see on Task Manager. Can you explain the reason of this difference? Heap PermGen 512 MB + 64 MB = 576 MB = 589824 KB 600980 KB Firs e-mail In our company, we are using apache tomcat as a windows service. We defined jvm parameters --JvmMs 512 --JvmMx 512 in service.bat. But application is using 600,980 KB memory. I expect the application not to use more then 512 MB. Thanks again. From: Caldarale, Charles R chuck.caldar...@unisys.com To: Tomcat Users List users@tomcat.apache.org Sent: Wed, January 27, 2010 10:32:01 PM Subject: RE: tomcat memory usage From: Christopher Schultz [mailto:ch...@christopherschultz.net] Subject: Re: tomcat memory usage What else goes into PermGen, other than java.lang.Class objects? It varies by JVM level. In the original HotSpot implementation it was pretty much just the instances of java.lang.Class. As things evolved, a lot of class/method/field metadata migrated into PermGen from the C heap, pushed there, I suspect, by the growing use and sophistication of JMX and JVMTI, as well as making it easier for GC to clean up dead classes. AFAIK, none of these secondary structures are directly visible to Java code. - 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. __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
RE: tomcat memory usage
From: Hüsnü Þentürk [mailto:husnusent...@yahoo.com] Subject: Re: tomcat memory usage Is following classifications true for memory usage of Java ? Pretty much, but you're missing ancillary bits such as libraries, OS-created structures, statically linked code, dynamically generated code, stacks, and probably other things I'm leaving out. Running a process in a modern OS is complicated. Sum of PermGen and Heap memory usage smalller then 600,980 KB which I see on Task Manager. Can you explain the reason of this difference? Just because the virtual space is reserved doesn't mean it's actually being used in real memory. I don't know which of the memory values you chose to display in Task Manager, but it's probably real memory usage, which is only that part of the process space that the OS happens to have loaded at that instant. Nearly all components of memory usage change over time, both in virtual space and real, and there is no definitive relationship between the two. In other words, the Task Manager number is not terribly useful for tuning a Java execution, but it does provide some information when you're looking at the system as a whole. - 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: tomcat memory usage
From: Pid [mailto:p...@pidster.com] Subject: Re: tomcat memory usage The overall size of the heap is controlled by 3 different groups of settings, not just the one you referred to: -Xms512M -Xmx512M -XX:NewSize=32m -XX:MaxNewSize=4096m -XX:PermSize=64m -XX:MaxPermSize=128m The overall amount of memory used is the sum of current values of each these groups, plus non-heap memory. (How'd I do?) Not well. The -Xmx and -Xms values include the NewSize; it is not a separate portion of the memory space as PermGen is. - 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: tomcat memory usage
On 29/01/2010 15:13, Caldarale, Charles R wrote: From: Pid [mailto:p...@pidster.com] Subject: Re: tomcat memory usage The overall size of the heap is controlled by 3 different groups of settings, not just the one you referred to: -Xms512M -Xmx512M -XX:NewSize=32m -XX:MaxNewSize=4096m -XX:PermSize=64m -XX:MaxPermSize=128m The overall amount of memory used is the sum of current values of each these groups, plus non-heap memory. (How'd I do?) Not well. The -Xmx and -Xms values include the NewSize; it is not a separate portion of the memory space as PermGen is. Dagnamit. So the MaxNewSize, despite often being seen at high values in jmap outputs, is actually only applicable if the 'mx' allows it? p - 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 - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: tomcat memory usage
From: Pid [mailto:p...@pidster.com] Subject: Re: tomcat memory usage So the MaxNewSize, despite often being seen at high values in jmap outputs, is actually only applicable if the 'mx' allows it? Correct. Do you have an example of an erroneous MaxNewSize display? I seem to recall some problems with 32-bit JVMs and incorrect treatment of unsigned integers causing problems in the past. - 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: tomcat memory usage
On 29/01/2010 15:27, Caldarale, Charles R wrote: From: Pid [mailto:p...@pidster.com] Subject: Re: tomcat memory usage So the MaxNewSize, despite often being seen at high values in jmap outputs, is actually only applicable if the 'mx' allows it? Correct. Do you have an example of an erroneous MaxNewSize display? I seem to recall some problems with 32-bit JVMs and incorrect treatment of unsigned integers causing problems in the past. Not to hand, I'll poke around. Probably the source of my confusion is that I think I remember seeing the default value of MaxNewSize as 4096M, despite having manually set a lower value for mx. p 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 - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: tomcat memory usage
From: Christopher Schultz [mailto:ch...@christopherschultz.net] Subject: Re: tomcat memory usage All Java objects and their associated data are stored within the heap. Well... no. The OP's original question was about what was outside the -Xmx heap setting, and Class objects and the associated static fields are /not/ included in that value. Instances of java.lang.Class and the static fields are kept in PermGen, which is separate from the regular Java heap, and sized independently of -Xmx. Unless you are writing JNI code, then everything you are effecting is happening in the heap. Also not strictly true, since a major chunk of the JVM and JRE are native code, and consume considerable amounts of process space to implement the Java operations. Static variables and references (which are the same thing, depending on how you see things) are not special in any way when it comes to memory use. Other than their location outside of the -Xmx-controlled heap. It's the JVM itself which is allocating memory outside that heap. And the OS and the various libraries used by the JVM. Many DLLs loaded into a process's memory space are, in fact, shared with many other processes. They're shared in real memory, but not process space (virtual memory). the fact that WTM shows you only a single number for memory means that you're not getting the whole story. The Task Manager can actually show several memory-related values, including virtual memory and various working set sizes. What's available to display depends heavily on the version of Windows one's using. So, maybe WTM is giving you a decent measure of what memory is actually being used by that process, specifically. Yes, it's pretty decent these days. Still has nothing to do with the Java heap, of course. - 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.
Re: tomcat memory usage
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Chuck, On 1/27/2010 11:28 AM, Caldarale, Charles R wrote: From: Christopher Schultz [mailto:ch...@christopherschultz.net] Subject: Re: tomcat memory usage All Java objects and their associated data are stored within the heap. Well... no. The OP's original question was about what was outside the -Xmx heap setting, and Class objects and the associated static fields are /not/ included in that value. Instances of java.lang.Class and the static fields are kept in PermGen, which is separate from the regular Java heap, and sized independently of -Xmx. Fair enough. Unless you are writing JNI code, then everything you are effecting is happening in the heap. Also not strictly true, since a major chunk of the JVM and JRE are native code, and consume considerable amounts of process space to implement the Java operations. What I meant was that you can create as many objects as you want in Java and you aren't really stepping outside the Java heap. If you write JNI code, you can call malloc as much as you want and /that/ would be outside the Java heap. The OP can only cause the JVM to allocate a lot of memory for non-Java-heap items indirectly... say, but opening a bunch of sockets, creating a bunch of threads, etc. Static variables and references (which are the same thing, depending on how you see things) are not special in any way when it comes to memory use. Other than their location outside of the -Xmx-controlled heap. So, static members are stored outside the heap? Where are they stored? PermGen? - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAktgiEkACgkQ9CaO5/Lv0PAKKACgmDoe/8LislL/gddXNbyaeENM 7ysAoI8pT7suqp0zPphCQEIng8K+1md1 =QVxm -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: tomcat memory usage
From: Christopher Schultz [mailto:ch...@christopherschultz.net] Subject: Re: tomcat memory usage So, static members are stored outside the heap? Where are they stored? PermGen? They're definitely not in the main Java heap; I'm pretty sure they're in PermGen, although it's been awhile since I've looked at that code. Keeping them in PermGen makes it easier for the all the GC reference-chasing logic to work. - 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.
Re: tomcat memory usage
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Chuck, On 1/27/2010 1:50 PM, Caldarale, Charles R wrote: From: Christopher Schultz [mailto:ch...@christopherschultz.net] Subject: Re: tomcat memory usage So, static members are stored outside the heap? Where are they stored? PermGen? They're definitely not in the main Java heap; I'm pretty sure they're in PermGen, although it's been awhile since I've looked at that code. Keeping them in PermGen makes it easier for the all the GC reference-chasing logic to work. This seems fishy to me. Consider the following. public class MyClass { public static Object staticObject = static; } The compiler knows that the staticObject member is static, and might even be able to tell the runtime that the object to be used for that static member should go into PermGen. But, now what happens if some other code does this: MyClass.staticObject = new String(new string); (I intentionally used the new keyword to force a new object creation at runtime... not sure what the compiler/runtime does with string constants within the constant pool). The bytecode for that looks roughly like this: new String ldc new string invokespecial String.init(String) putstatic MyClass.staticObject The runtime doesn't know until the putstatic call that the object is destined to be a static reference. Even if the compiler and runtime were to collude to make this happen in this contrived example, any long-living, heap-allocated object could be attached to a static member at any time without warning. Does that mean that the putstatic opcode likely does one of two things: 1. Immediately promote that object into the PermGen space 2. Marks the object as destined for PermGen so that the GC can move it whenever it wants In either case, each object would need not only a regular reference count but also a static reference count in case the object was still relevant but no longer bound to a static member, in which case it should be moved /back/ into the regular heap? That sounds like more work than is really necessary for the GC to perform. Why not just have objects that end up bound to static members grow old and move into the old generation just like most long-lived objects? - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAktglCkACgkQ9CaO5/Lv0PDr3ACdGSJQxadZHAHx5bjyjSRDpqyL /xEAn11hQJeGlz7H6dAlgecQElJTGSD0 =AKd+ -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: tomcat memory usage
From: Christopher Schultz [mailto:ch...@christopherschultz.net] Subject: Re: tomcat memory usage The compiler knows that the staticObject member is static, and might even be able to tell the runtime that the object to be used for that static member should go into PermGen. You're confusing the reference with the object it points to. The field containing the reference is in PermGen, the object the reference refers to is in the main heap. The runtime doesn't know until the putstatic call that the object is destined to be a static reference. See above; reference != object, but reference == pointer to object. (But I think you know that.) any long-living, heap-allocated object could be attached to a static member at any time without warning. Sure; it happens all the time. Does that mean that the putstatic opcode likely does one of two things: 1. Immediately promote that object into the PermGen space 2. Marks the object as destined for PermGen so that the GC can move it whenever it wants No, the object will never migrate to PermGen space. (Nothing ever migrates across the PermGen / main heap boundary, in either direction.) In either case, each object would need not only a regular reference count but also a static reference count No Java GC mechanism has used reference counting for close to ten years now. All GC operations are performed by following reference chains from the roots (subject to a ton of acceleration techniques that avoid following all paths on all GCs). Why not just have objects that end up bound to static members grow old and move into the old generation just like most long-lived objects? They do exactly that. The fact that a reference field is static says nothing about the expected lifetime of what the reference refers to. - 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.
AW: tomcat memory usage
Hi So, static members are stored outside the heap? Where are they stored? PermGen? For sure, no. ALL persistent java objects are on the heap. With optimization some very short living objects may reside on the stack only. References to static objects ARE probably stored in PermGen, but the objects themselfes are surely not. They are created as any other object during object initialization using the new operator. I am not sure, where the Class objects themselfes reside. Maybe they are on PermGen or they are in the heap and are referenced in PermGen. Whereever they are, static references are in there. Regards, Steffen smime.p7s Description: S/MIME cryptographic signature
RE: tomcat memory usage
From: Steffen Heil [mailto:li...@steffen-heil.de] Subject: AW: tomcat memory usage I am not sure, where the Class objects themselfes reside. They are in PermGen along with a very few other internally-generated structures. Whereever they are, static references are in there. Actually, there's no requirement that static fields be in the java.lang.Class instance or even in PermGen, as long as the interpreter, the two JITs, and GC know how to find them. It would be easy to locate static fields on the C heap, with just a pointer in the native part of the java.lang.Class instance to the location. But I believe they actually are in PermGen, since that makes the card table marking easier when a reference field is updated via putstatic. - 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.
Re: tomcat memory usage
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Chuck, On 1/27/2010 2:50 PM, Caldarale, Charles R wrote: From: Christopher Schultz [mailto:ch...@christopherschultz.net] Subject: Re: tomcat memory usage The compiler knows that the staticObject member is static, and might even be able to tell the runtime that the object to be used for that static member should go into PermGen. You're confusing the reference with the object it points to. The field containing the reference is in PermGen, the object the reference refers to is in the main heap. I /was/ confused about your description, and I was sure that the object itself was stored in the heap. All you're saying is that, since Class objects are stored in PermGen, the memory required for their static object references is also stored in PermGen. That makes complete sense to me. The runtime doesn't know until the putstatic call that the object is destined to be a static reference. See above; reference != object, but reference == pointer to object. (But I think you know that.) Thanks for the OO semantics lesson, professor :) I think my above statement was missing the pointed to by a static reference. No, the object will never migrate to PermGen space. (Nothing ever migrates across the PermGen / main heap boundary, in either direction.) Good to know. What else goes into PermGen, other than java.lang.Class objects? - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAktgoPUACgkQ9CaO5/Lv0PBmwQCeKZrCwPTT9Kp8V8qswxCZ4OKk Q3AAoJpZYaVBSGoQPmYn1c92mGxSlsHk =UiYy -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: tomcat memory usage
From: Christopher Schultz [mailto:ch...@christopherschultz.net] Subject: Re: tomcat memory usage What else goes into PermGen, other than java.lang.Class objects? It varies by JVM level. In the original HotSpot implementation it was pretty much just the instances of java.lang.Class. As things evolved, a lot of class/method/field metadata migrated into PermGen from the C heap, pushed there, I suspect, by the growing use and sophistication of JMX and JVMTI, as well as making it easier for GC to clean up dead classes. AFAIK, none of these secondary structures are directly visible to Java code. - 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.
tomcat memory usage
Hi, In our company, we are using apache tomcat as a windows service. We defined jvm parameters --JvmMs 512 --JvmMx 512 in service.bat. But application is using 600,980 KB memory. I expect the application not to use more then 512 MB. Can you explain me, the reason of this stuation. Informations: -- Server version: Apache Tomcat/6.0.20 Server built: May 14 2009 01:13:50 Server number: 6.0.20.0 OS Name: Windows 2003 OS Version: 5.2 Architecture: x86 JVM Version: 1.5.0_04-b05 JVM Vendor: Sun Microsystems Inc. Thanks. Husnu Senturk
Re: tomcat memory usage
On 26/01/2010 15:12, Hüsnü Þentürk wrote: Hi, In our company, we are using apache tomcat as a windows service. We defined jvm parameters --JvmMs 512 --JvmMx 512 in service.bat. But application is using 600,980 KB memory. I expect the application not to use more then 512 MB. Can you explain me, the reason of this stuation. Assuming they're actually working, those settings only govern the size of the heap. The JVM uses memory for things that are not part of the heap. p Informations: -- Server version: Apache Tomcat/6.0.20 Server built: May 14 2009 01:13:50 Server number: 6.0.20.0 OS Name:Windows 2003 OS Version: 5.2 Architecture: x86 JVM Version:1.5.0_04-b05 JVM Vendor: Sun Microsystems Inc. Thanks. Husnu Senturk - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: tomcat memory usage
2010/1/26 Hüsnü Þentürk husnusent...@yahoo.com Hi, In our company, we are using apache tomcat as a windows service. We defined jvm parameters --JvmMs 512 --JvmMx 512 in service.bat. But application is using 600,980 KB memory. I expect the application not to use more then 512 MB. Can you explain me, the reason of this stuation. You are setting the memory that Java uses to store heap objects. That is not the only memory Java uses. Other uses include: - The JVM code itself; - Native code stacks per-thread; - Native objects such as sockets and threads; - Any loaded DLLs. You have no direct way of controlling the size of any of these. If you want to reduce Java's memory usage, you can reduce its heap space after monitoring what the process' overheads are. - Peter
Re: tomcat memory usage
As far as I know, heap memory is used by objects. On the other hand, our application has static variables and references to the objects residing in heap area. Does it mean, static variables and references of our application are stored outside of reserved 512MB area? Or, the memory outside of 512MB reserved heap area used only by Java itself? From: Peter Crowther peter.crowt...@melandra.com To: Tomcat Users List users@tomcat.apache.org Sent: Tue, January 26, 2010 5:43:22 PM Subject: Re: tomcat memory usage 2010/1/26 Hüsnü Þentürk husnusent...@yahoo.com Hi, In our company, we are using apache tomcat as a windows service. We defined jvm parameters --JvmMs 512 --JvmMx 512 in service.bat. But application is using 600,980 KB memory. I expect the application not to use more then 512 MB. Can you explain me, the reason of this stuation. You are setting the memory that Java uses to store heap objects. That is not the only memory Java uses. Other uses include: - The JVM code itself; - Native code stacks per-thread; - Native objects such as sockets and threads; - Any loaded DLLs. You have no direct way of controlling the size of any of these. If you want to reduce Java's memory usage, you can reduce its heap space after monitoring what the process' overheads are. - Peter
Re: Tomcat memory settings
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Leo, On 1/14/2010 11:48 AM, Leo Donahue - PLANDEVX wrote: Thank you for the feedback. I followed Chuck's advice and set the initial and maximum memory pool using the tomcat6w.exe I have both values set to 512MB. As Chuck suggests, that's a bit small, especially if you are manipulating large data sets. I suspect that a GIS data set is quite large, though with an 87MiB heap size after initialization, I would guess that you don't need it all. (Chuck: we use a 196MiB heap for our big webapp and it's working fine! :) Windows Server 2003 Standard SP2 32-bit Tomcat 6.0.20 The Java Virtual Machine: C:\Program Files\Java\jdk1.6.0_14\jre\bin\server\jvm.dll Looking at the log files, the OOME appears in the logs after long periods of time. Yesterday the message did not appear in the logs until 1:50 AM. What time did you start it? :) When Tomcat starts, it is consuming around 87MB of memory and by tomorrow it will grow to around 118MB and somewhere in between there will be a OOME message in the logs. The webapp still works though. Okay, I'll bet I know what's happening. Since your webapp works properly after the OOME, and the heap is still relatively small (118MiB heap size while the maximum is 512MiB). I think what's happening is that your webapp, during one request, is trying to allocate a whole bunch of memory all at once: it's probably trying to load a ton of GIS data from a larger database, or maybe trying to do something with an image that ends up being rather large. The allocation fails, the OOME is thrown, but neither the application nor the JVM suffers: subsequent requests are properly handled... it's just that one request that fell on its face. I'm not sure if you can trigger a thread dump on OOME, but that would be very interesting: if one thread always says that it's running a method called allocateHugeArray() or something, that may be your culprit. Do the ArcIMS folks recommend a particular heap size for use with their API / database? You might want to consult with them about an appropriately-sized heap for your needs. Was ArcIMS designed to be used in a multi-user environment? It's possible that you can't get decent performance with multiple simultaneous queries against their database. In that case, all is not lost: you can write your own wrapper around the ArcIMS API that will limit the number of simultaneous requests to something more manageable. I realize that my issue is now probably not related so much to Tomcat but probably the design of the webapp. This is usually the case, although Tomcat bugs /have/ been found in the past. Do you keep a lot of information in users' sessions? I don't know, I'm only keeping one string value which is what the user enters into the query text field. The session timeout is set to 5 minutes. If you're talking about the search string from below (211-52-011A), then this is what we call nothing. Don't worry about this. The memory allocated for management of the session itself (very small) outweighs this trivial amount of memory to store that string. Unless you don't limit the length of the string you're willing to accept via the web interface and/or store in the session. You might want to check that. How about in the application context? I'm not using any init params, if that is what you mean. No, that's not what I mean. Many applications do some preliminary work when they start up, maybe by loading static data from a database and caching it in what's called the application scope which is represented by a ServletContext object. You can get a lot of information about what is where using a utility I wrote called the SessionSnooper. You can find it here under JSP Utilities: http://christopherschultz.net/projects/java/ You can see what is being stored where in your web application (application, session, and request scopes). You can also get JVM memory information, too. This might help you see what is being stored in there, although it doesn't do anything cool like try to calculate the size of anything. It just tells you the hash keys (which are string values) and allows you to print the result of toString() called on each item. Does your webapp do anything that you expect to require very heavy memory consumption (image manipulation, in-memory representations of large datasets, etc.)? For each request, if the value is found in the datasource, up to 40 other beans are instantiated and compared to the result of the request. There is also one image that is returned in the process. You can view it here: http://planning.maricopa.gov/plannetquickinfo Depending on the size of these beans, you might have a situation where a lot of memory is allocated all at once due to one of these requests. If it comes down to it, you might have to use a debugger to see what is happening. Definitely enable some kind of access logging. You might even want to add some debugging logging to your
RE: Tomcat memory settings
Chris, Thank you for the feedback. I followed Chuck's advice and set the initial and maximum memory pool using the tomcat6w.exe I have both values set to 512MB. Windows Server 2003 Standard SP2 32-bit Tomcat 6.0.20 The Java Virtual Machine: C:\Program Files\Java\jdk1.6.0_14\jre\bin\server\jvm.dll Looking at the log files, the OOME appears in the logs after long periods of time. Yesterday the message did not appear in the logs until 1:50 AM. When Tomcat starts, it is consuming around 87MB of memory and by tomorrow it will grow to around 118MB and somewhere in between there will be a OOME message in the logs. The webapp still works though. I hope I can answer the following but I'll admit to you now, I'm not 100% sure I know what I'm doing. Hopefully you will keep the laughter to a minimum as a courtesy? I realize that my issue is now probably not related so much to Tomcat but probably the design of the webapp. Do you keep a lot of information in users' sessions? I don't know, I'm only keeping one string value which is what the user enters into the query text field. The session timeout is set to 5 minutes. How about in the application context? I'm not using any init params, if that is what you mean. Does your webapp cache a lot of information? I don't know. Do you use a database connection pool? If so, which one? What is the configuration? No. I am using a vendor API that makes a connection to their datasource. The user enters a value in the JSF page, the action event is tied to a method that looks up the value in the datasource, if the value was found then page navigation ocurrs and displays results, if the value was not found a message is displayed on the JSF page indicating the value was not found, using the messages tag. Does your webapp do anything that you expect to require very heavy memory consumption (image manipulation, in-memory representations of large datasets, etc.)? For each request, if the value is found in the datasource, up to 40 other beans are instantiated and compared to the result of the request. There is also one image that is returned in the process. You can view it here: http://planning.maricopa.gov/plannetquickinfo You can use parcel: 211-52-011A as an example search. -Original Message- From: Christopher Schultz [mailto:ch...@christopherschultz.net] Sent: Wednesday, January 13, 2010 2:03 PM To: Tomcat Users List Subject: Re: Tomcat memory settings -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Leo, On 1/11/2010 2:29 PM, Leo Donahue - PLANDEVX wrote: org.apache.catalina.core.StandardWrapperValve invoke SEVERE: Servlet.service() for servlet servlet name threw exception java.lang.OutOfMemoryError: Java heap space To add to what others have said, getting an OOME can mean one of two things: 1. Your webapp simply needs more memory than you are allocating 2. You have a resource leak Most often, #2 is the culprit. Under what conditions are you getting the OOME? Lots of users after a short period of uptime, or all by yourself on your development environment after a long period of time? Do you keep a lot of information in users' sessions? How about in the application context? Does your webapp cache a lot of information? Do you use a database connection pool? If so, which one? What is the configuration? Does your webapp do anything that you expect to require very heavy memory consumption (image manipulation, in-memory representations of large datasets, etc.)? If so, you may simply need more memory to properly run your webapp. Finally, with a 32-bit JVM (you didn't say which you were using), you'll top-out around 2GiB for your heap no matter how much physical RAM you have. If you need more than 2GiB of heap, you'll need to go with a 64-bit environment. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAktONOkACgkQ9CaO5/Lv0PAEMACfaS7G/FPgvCkEG1j4tS7mQkrC PkgAn3CYEh4D8eEa4FJdlLAIp7VmOIWZ =/cyT -END PGP SIGNATURE- - 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: Tomcat memory settings
On 14/01/2010 16:48, Leo Donahue - PLANDEVX wrote: Chris, Thank you for the feedback. I followed Chuck's advice and set the initial and maximum memory pool using the tomcat6w.exe I have both values set to 512MB. Windows Server 2003 Standard SP2 32-bit Tomcat 6.0.20 The Java Virtual Machine: C:\Program Files\Java\jdk1.6.0_14\jre\bin\server\jvm.dll Looking at the log files, the OOME appears in the logs after long periods of time. Yesterday the message did not appear in the logs until 1:50 AM. When Tomcat starts, it is consuming around 87MB of memory and by tomorrow it will grow to around 118MB and somewhere in between there will be a OOME message in the logs. The webapp still works though. I hope I can answer the following but I'll admit to you now, I'm not 100% sure I know what I'm doing. Hopefully you will keep the laughter to a minimum as a courtesy? I realize that my issue is now probably not related so much to Tomcat but probably the design of the webapp. Do you keep a lot of information in users' sessions? I don't know, I'm only keeping one string value which is what the user enters into the query text field. The session timeout is set to 5 minutes. If the string value is short, probably not then. How about in the application context? I'm not using any init params, if that is what you mean. Sort of. Does your webapp cache a lot of information? I don't know. OK. Do you use a database connection pool? If so, which one? What is the configuration? No. I am using a vendor API that makes a connection to their datasource. The user enters a value in the JSF page, the action event is tied to a method that looks up the value in the datasource, if the value was found then page navigation ocurrs and displays results, if the value was not found a message is displayed on the JSF page indicating the value was not found, using the messages tag. A resource leak is when, for example, a database connection is opened but not properly closed. Each time it's opened it's using a bit of memory that isn't returned, because the connection is not closed. It can be hard, but not impossible, to track down the source of this type of problem. Does your webapp do anything that you expect to require very heavy memory consumption (image manipulation, in-memory representations of large datasets, etc.)? For each request, if the value is found in the datasource, up to 40 other beans are instantiated and compared to the result of the request. There is also one image that is returned in the process. You can view it here: http://planning.maricopa.gov/plannetquickinfo You can use parcel: 211-52-011A as an example search. Where does the image come from and how is it handled? Sometimes image generation can be a problem. Have you had to write any code to make the app work? p -Original Message- From: Christopher Schultz [mailto:ch...@christopherschultz.net] Sent: Wednesday, January 13, 2010 2:03 PM To: Tomcat Users List Subject: Re: Tomcat memory settings -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Leo, On 1/11/2010 2:29 PM, Leo Donahue - PLANDEVX wrote: org.apache.catalina.core.StandardWrapperValve invoke SEVERE: Servlet.service() for servlet servlet name threw exception java.lang.OutOfMemoryError: Java heap space To add to what others have said, getting an OOME can mean one of two things: 1. Your webapp simply needs more memory than you are allocating 2. You have a resource leak Most often, #2 is the culprit. Under what conditions are you getting the OOME? Lots of users after a short period of uptime, or all by yourself on your development environment after a long period of time? Do you keep a lot of information in users' sessions? How about in the application context? Does your webapp cache a lot of information? Do you use a database connection pool? If so, which one? What is the configuration? Does your webapp do anything that you expect to require very heavy memory consumption (image manipulation, in-memory representations of large datasets, etc.)? If so, you may simply need more memory to properly run your webapp. Finally, with a 32-bit JVM (you didn't say which you were using), you'll top-out around 2GiB for your heap no matter how much physical RAM you have. If you need more than 2GiB of heap, you'll need to go with a 64-bit environment. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAktONOkACgkQ9CaO5/Lv0PAEMACfaS7G/FPgvCkEG1j4tS7mQkrC PkgAn3CYEh4D8eEa4FJdlLAIp7VmOIWZ =/cyT -END PGP SIGNATURE- - 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
RE: Tomcat memory settings
Where does the image come from and how is it handled? Sometimes image generation can be a problem. The image is generated by software called ArcIMS. ArcIMS uses a xml file called a map configuration file that has pointers to all of the GIS data layers and images. The map configuration file is held in memory. The ArcIMS API handles the image generation and provides the mechanism for connecting to the server, data layers, and making spatial queries against the geometry of the parcel the user enters. Images are generated on the server and placed in an output directory accessible via a URL. Essentially, the ArcIMS API has methods to get the geometry of the parcel the user enters, create a polygon, uses that polygon to compare whether any of the other 40+ layers possibly intersect the polygon, get each GIS layer recordset that intersects, and the map image associated with the map extent - which is a buffer of the geometry of the parcel by a distance of 500'. Each of the 40+ layers have their own bean for place holders for the GIS layer recordsets and I use h:dataTable to iterate over those records. Each bean is an array of arrays since it is possible that more than one attribute of a layer intersects the given parcel. Have you had to write any code to make the app work? All of it. It was just an idea I had to try to offer a non-map-interactive query tool for the user. I didn't create the ArcIMS API, I'm just working with it. I suspect that my problem is design and I'm sure it relates to having a session. When is the right time to close a data connection during a session? It seems like I need to have some code that determines the age of the session and then does some object cleanup? The only reason I have a session at all is to make a round trip to the server to enable the search button and display a message when a parcel is not found. What I thought was going to be an easy webapp has burgeoned into something much larger. I'm sorry if I've turned this thread into a non-Tomcat issue. But I really appreciate the feedback. Leo -Original Message- From: Pid [mailto:p...@pidster.com] Sent: Thursday, January 14, 2010 10:49 AM To: users@tomcat.apache.org Subject: Re: Tomcat memory settings On 14/01/2010 16:48, Leo Donahue - PLANDEVX wrote: Chris, Thank you for the feedback. I followed Chuck's advice and set the initial and maximum memory pool using the tomcat6w.exe I have both values set to 512MB. Windows Server 2003 Standard SP2 32-bit Tomcat 6.0.20 The Java Virtual Machine: C:\Program Files\Java\jdk1.6.0_14\jre\bin\server\jvm.dll Looking at the log files, the OOME appears in the logs after long periods of time. Yesterday the message did not appear in the logs until 1:50 AM. When Tomcat starts, it is consuming around 87MB of memory and by tomorrow it will grow to around 118MB and somewhere in between there will be a OOME message in the logs. The webapp still works though. I hope I can answer the following but I'll admit to you now, I'm not 100% sure I know what I'm doing. Hopefully you will keep the laughter to a minimum as a courtesy? I realize that my issue is now probably not related so much to Tomcat but probably the design of the webapp. Do you keep a lot of information in users' sessions? I don't know, I'm only keeping one string value which is what the user enters into the query text field. The session timeout is set to 5 minutes. If the string value is short, probably not then. How about in the application context? I'm not using any init params, if that is what you mean. Sort of. Does your webapp cache a lot of information? I don't know. OK. Do you use a database connection pool? If so, which one? What is the configuration? No. I am using a vendor API that makes a connection to their datasource. The user enters a value in the JSF page, the action event is tied to a method that looks up the value in the datasource, if the value was found then page navigation ocurrs and displays results, if the value was not found a message is displayed on the JSF page indicating the value was not found, using the messages tag. A resource leak is when, for example, a database connection is opened but not properly closed. Each time it's opened it's using a bit of memory that isn't returned, because the connection is not closed. It can be hard, but not impossible, to track down the source of this type of problem. Does your webapp do anything that you expect to require very heavy memory consumption (image manipulation, in-memory representations of large datasets, etc.)? For each request, if the value is found in the datasource, up to 40 other beans are instantiated and compared to the result of the request. There is also one image that is returned in the process. You can view it here: http://planning.maricopa.gov/plannetquickinfo You can use parcel: 211-52-011A as an example
RE: Tomcat memory settings
From: Leo Donahue - PLANDEVX [mailto:leodona...@mail.maricopa.gov] Subject: RE: Tomcat memory settings I have both values set to 512MB. That's actually kind of small for this day and age, even on a 32-bit system. Looking at the log files, the OOME appears in the logs after long periods of time. Another indication (but not proof) that it's a memory leak in your webapp. somewhere in between there will be a OOME message in the logs. The webapp still works though. It's unusual that things keep working after an OOME. Try setting -XX:+HeapDumpOnOutOfMemoryError; this will produce a file that you can analyze with jhat (part of JDK6) or other tools to see just what's consuming the space. You can also use JVisualVM (again part of JDK6) to take periodic snapshots of the heap and monitor the heap usage in real-time, without significant impact on the performance of the monitored system. If you have the CPU headroom, you can also use a heap profiler to track activity; this will capture not only the objects in the heap, but also the call stacks at the time of object creation. - 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: Tomcat memory settings
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Leo, On 1/11/2010 2:29 PM, Leo Donahue - PLANDEVX wrote: org.apache.catalina.core.StandardWrapperValve invoke SEVERE: Servlet.service() for servlet servlet name threw exception java.lang.OutOfMemoryError: Java heap space To add to what others have said, getting an OOME can mean one of two things: 1. Your webapp simply needs more memory than you are allocating 2. You have a resource leak Most often, #2 is the culprit. Under what conditions are you getting the OOME? Lots of users after a short period of uptime, or all by yourself on your development environment after a long period of time? Do you keep a lot of information in users' sessions? How about in the application context? Does your webapp cache a lot of information? Do you use a database connection pool? If so, which one? What is the configuration? Does your webapp do anything that you expect to require very heavy memory consumption (image manipulation, in-memory representations of large datasets, etc.)? If so, you may simply need more memory to properly run your webapp. Finally, with a 32-bit JVM (you didn't say which you were using), you'll top-out around 2GiB for your heap no matter how much physical RAM you have. If you need more than 2GiB of heap, you'll need to go with a 64-bit environment. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAktONOkACgkQ9CaO5/Lv0PAEMACfaS7G/FPgvCkEG1j4tS7mQkrC PkgAn3CYEh4D8eEa4FJdlLAIp7VmOIWZ =/cyT -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Tomcat memory settings
Tomcat 6.0.20 zip (used service command to run as windows service) Window 2003 Server 2.0GB RAM (1.3GB available) My problem: org.apache.catalina.core.StandardWrapperValve invoke SEVERE: Servlet.service() for servlet servlet name threw exception java.lang.OutOfMemoryError: Java heap space I've read many previous posts and online articles about increasing the memory settings for Tomcat. As it stands, I've modified the catalina.bat file and set the CATALINA_OPTS variable from what was nothing to the following: :doStop shift set ACTION=stop set CATALINA_OPTS=-Xms256m -Xmx512m goto execCmd I have restarted Tomcat. 1. Was that the right way to increase the memory for Tomcat 6.0.20? 2. Do I monitor the log files to see if this setting was enough? I realize there could be many other things related to heap space errors. Leo Donahue
Re: Tomcat memory settings
http://www.theserverside.com/news/thread.tss?thread_id=48390 http://wiki.apache.org/tomcat/FAQ/Memory Try googling On 01/11/2010 11:29 AM, Leo Donahue - PLANDEVX wrote: Tomcat 6.0.20 zip (used service command to run as windows service) Window 2003 Server 2.0GB RAM (1.3GB available) My problem: org.apache.catalina.core.StandardWrapperValve invoke SEVERE: Servlet.service() for servlet servlet name threw exception java.lang.OutOfMemoryError: Java heap space I've read many previous posts and online articles about increasing the memory settings for Tomcat. As it stands, I've modified the catalina.bat file and set the CATALINA_OPTS variable from what was nothing to the following: :doStop shift set ACTION=stop set CATALINA_OPTS=-Xms256m -Xmx512m goto execCmd I have restarted Tomcat. 1. Was that the right way to increase the memory for Tomcat 6.0.20? 2. Do I monitor the log files to see if this setting was enough? I realize there could be many other things related to heap space errors. Leo Donahue - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: Tomcat memory settings
From: Leo Donahue - PLANDEVX [mailto:leodona...@mail.maricopa.gov] Subject: Tomcat memory settings I've read many previous posts and online articles about increasing the memory settings for Tomcat. As it stands, I've modified the catalina.bat file and set the CATALINA_OPTS variable from what was nothing to the following: That does nothing for the service, which does not use the .bat scripts. Use the bin/tomcat6w.exe program to manipulate the heap settings, which are on the Java tab of the GUI. I'd recommend setting min and max heap sizes to the same value to avoid thrashing. - 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: Tomcat Memory and Garbage Collection questions...
I see odd behavior. Our tomcat setting is set for a max memory setting of 256Mb in our Development Environment. Yet it goes over 256Mb. Up to 290Mb. I assumed that it would never go over 256Mb in task manager. Is that correct? thanks Answers Below as well... -Original Message- From: Caldarale, Charles R [mailto:chuck.caldar...@unisys.com] Sent: Monday, November 02, 2009 4:06 PM To: Tomcat Users List Subject: RE: Tomcat Memory and Garbage Collection questions... From: Johnson, Trevin (Contractor) [mailto:trevin.john...@occ.treas.gov] Subject: Tomcat Memory and Garbage Collection questions... When we restart the tomcat service our tomcat memory is about 120Mb. It keeps going up over the next few days util it reaches 700Mb and we have to reboot the server. Why do you reboot? Is the server unresponsive? -We actually just restart Tomcat service and it goes back down to about 120Mb 1.We do not see the memory going down for the tomcat service. Shouldn't the memory go down as well as up over this timespan What are you using to show the memory usage? -We are using task manager to show Tomcat memory usage 2.Should the memory get to maximum 768Mb and then go back down or get recycled? Depends on what you're looking at. If it's Task Manager, it won't go down. If you're using JConsole to look at the heap, it should go up and down. 3.Is this a bug or what is normal behavior for the tomcat memory? Depends; see above. 4.. How do we implement garbage collection for our windows server(- Xincgc)? Garbage collection is always present. Incremental GC can be useful to minimize pause times, but it is more overhead and has some restrictions on just what it can collect. Unless you really think you need that option, I wouldn't set it right now. I'd strongly recommend using JConsole to look at heap usage, then use a profiler if you find that the heap usage does not stabilize. You can also turn on -verbose:gc, and use jhat and jmap to do basic heap analysis. Some useful resources: http://java.sun.com/j2se/1.5.0/docs/guide/vm/gc-ergonomics.html http://java.sun.com/javase/technologies/hotspot/gc/index.jsp - 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 - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: Tomcat Memory and Garbage Collection questions...
From: Johnson, Trevin (Contractor) [mailto:trevin.john...@occ.treas.gov] Subject: RE: Tomcat Memory and Garbage Collection questions... I see odd behavior. Our tomcat setting is set for a max memory setting of 256Mb in our Development Environment. Yet it goes over 256Mb. Up to 290Mb. I assumed that it would never go over 256Mb in task manager. Is that correct? Your assumption is incorrect. The Java heap limit is only part of the total process space, which is what Task Manager is showing; also included in the process space is code, the C heap, stacks, and lots of OS overhead. Task Manager is a dismally poor means of discovering any real information. - 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: Tomcat Memory and Garbage Collection questions...
you're going to want to trap the stack and heap parameters with all the tools chuck mentioned you're going to want to note which webapps are being loaded and where (do you have a cluster) track ALL the resource changes you make specifically Database resources which can consume unrestricted heap as well any any file i/o or graphic packages loaded in the end run heap space not being reclaimed can be caused by a thousand different things we can provide a comprehensive solution if we would be able to submit bids for a statement of work where one of us will come down and take a look thanks, Martin Gainty __ do not modify or alter this transmission. Thank You From: trevin.john...@occ.treas.gov To: users@tomcat.apache.org Date: Thu, 5 Nov 2009 17:26:14 -0500 Subject: RE: Tomcat Memory and Garbage Collection questions... I see odd behavior. Our tomcat setting is set for a max memory setting of 256Mb in our Development Environment. Yet it goes over 256Mb. Up to 290Mb. I assumed that it would never go over 256Mb in task manager. Is that correct? thanks Answers Below as well... -Original Message- From: Caldarale, Charles R [mailto:chuck.caldar...@unisys.com] Sent: Monday, November 02, 2009 4:06 PM To: Tomcat Users List Subject: RE: Tomcat Memory and Garbage Collection questions... From: Johnson, Trevin (Contractor) [mailto:trevin.john...@occ.treas.gov] Subject: Tomcat Memory and Garbage Collection questions... When we restart the tomcat service our tomcat memory is about 120Mb. It keeps going up over the next few days util it reaches 700Mb and we have to reboot the server. Why do you reboot? Is the server unresponsive? -We actually just restart Tomcat service and it goes back down to about 120Mb 1.We do not see the memory going down for the tomcat service. Shouldn't the memory go down as well as up over this timespan What are you using to show the memory usage? -We are using task manager to show Tomcat memory usage 2.Should the memory get to maximum 768Mb and then go back down or get recycled? Depends on what you're looking at. If it's Task Manager, it won't go down. If you're using JConsole to look at the heap, it should go up and down. 3.Is this a bug or what is normal behavior for the tomcat memory? Depends; see above. 4.. How do we implement garbage collection for our windows server(- Xincgc)? Garbage collection is always present. Incremental GC can be useful to minimize pause times, but it is more overhead and has some restrictions on just what it can collect. Unless you really think you need that option, I wouldn't set it right now. I'd strongly recommend using JConsole to look at heap usage, then use a profiler if you find that the heap usage does not stabilize. You can also turn on -verbose:gc, and use jhat and jmap to do basic heap analysis. Some useful resources: http://java.sun.com/j2se/1.5.0/docs/guide/vm/gc-ergonomics.html http://java.sun.com/javase/technologies/hotspot/gc/index.jsp - 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 - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org _ Find the right PC with Windows 7 and Windows Live. http://www.microsoft.com/Windows/pc-scout/laptop-set-criteria.aspx?cbid=wlfilt=200,2400,10,19,1,3,1,7,50,650,2,12,0,1000cat=1,2,3,4,5,6brands=5,6,7,8,9,10,11,12,13,14,15,16addf=4,5,9ocid=PID24727::T:WLMTAGL:ON:WL:en-US:WWL_WIN_evergreen2:112009
RE: Tomcat Memory and Garbage Collection questions...
Elli Thanks for the reply. I also missed josephs (unless there is several of these threads going on). Hot deployment is what we would like to do. It's not possible as yet because of eventual permgen memory errors. I also (in general) think it's a good idea to _know what we're doing_ so some of this is trying to ensure the apps we're building are healthy. I think an initial part of the problem is commons-logging. Specifically how we are using it. We have also found the cas-client-core needed to be updated to 3.1.8 as it had it's own issues. I've experimented with putting both commons-logging and log4j in the tomcat library and that appears to work, but from some of the reading you guys have provided I suspect that commons logging should probably be in the context and log4j in tomcat. The comment about programmers pushing to much into session attributes is probably another candidate, though I suspect that is causing a slow down in the clean up and not a permanent problem (yet). Shall continue the search... Gerwood From: Elli Albek [e...@sustainlane.com] Sent: Tuesday, 3 November 2009 6:56 PM To: Tomcat Users List Subject: Re: Tomcat Memory and Garbage Collection questions... A question: Do you guys use hot deployment of applications? If you do *not*, then Joseph’s tips are the first things to look at, in short it is the application code keeping too many references. If you do hot deployment, then the number of possibilities goes up significantly. Now you are also talking about references to class loaders and memory cleanup at shutdown, which is another topic altogether. E On Mon, Nov 2, 2009 at 1:44 PM, Joseph Morgan joseph.mor...@ignitesales.com wrote: I hope Mr. Caldarale answered your question, because you may otherwise be looking at the 800lb Gorilla in the room. Memory problems within Tomcat could be a number of very hard to see things, but some quick candidates are: * Programmers caching too much data from the DB (or file system) into context attributes * Programmers using context attributes to store session data * Programmers pushing too much data into session attributes * Session timeout is set too high and sessions aren't timing out - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Tomcat Memory and Garbage Collection questions...
Hello OS Version: Windows 2000 Tomcat version:5.5.17 Initial Memory Pool: 768 Maximum Memory Pool:1024 Java Version: Java\jdk1.5.0_14 When we restart the tomcat service our tomcat memory is about 120Mb. It keeps going up over the next few days util it reaches 700Mb and we have to reboot the server. We do not see any errors just yet but the server gets close to maxing out I have questions around garbage collection for tomcat Questions: 1.We do not see the memory going down for the tomcat service. Shouldn't the memory go down as well as up over this timespan 2.Should the memory get to maximum 768Mb and then go back down or get recycled? 3.Is this a bug or what is normal behavior for the tomcat memory? 4.. How do we implement garbage collection for our windows server(-Xincgc)? I am very new to Tomcat and trying to manage/decrease the memory footprint used by Tomcat? Your help is most appreciated... Thanks trevin.john...@occ.treas.gov
RE: Tomcat Memory and Garbage Collection questions...
From: Johnson, Trevin (Contractor) [mailto:trevin.john...@occ.treas.gov] Subject: Tomcat Memory and Garbage Collection questions... When we restart the tomcat service our tomcat memory is about 120Mb. It keeps going up over the next few days util it reaches 700Mb and we have to reboot the server. Why do you reboot? Is the server unresponsive? 1.We do not see the memory going down for the tomcat service. Shouldn't the memory go down as well as up over this timespan What are you using to show the memory usage? 2.Should the memory get to maximum 768Mb and then go back down or get recycled? Depends on what you're looking at. If it's Task Manager, it won't go down. If you're using JConsole to look at the heap, it should go up and down. 3.Is this a bug or what is normal behavior for the tomcat memory? Depends; see above. 4.. How do we implement garbage collection for our windows server(- Xincgc)? Garbage collection is always present. Incremental GC can be useful to minimize pause times, but it is more overhead and has some restrictions on just what it can collect. Unless you really think you need that option, I wouldn't set it right now. I'd strongly recommend using JConsole to look at heap usage, then use a profiler if you find that the heap usage does not stabilize. You can also turn on -verbose:gc, and use jhat and jmap to do basic heap analysis. Some useful resources: http://java.sun.com/j2se/1.5.0/docs/guide/vm/gc-ergonomics.html http://java.sun.com/javase/technologies/hotspot/gc/index.jsp - 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: Tomcat Memory and Garbage Collection questions...
Hi, in fact, garbage collection is not tomcat stuff. It is JVM responsibility. So try to focus on jvm memory problem, not tomcat memory problem. Maybe some memory leak? Martin 2009/11/2 Johnson, Trevin (Contractor) trevin.john...@occ.treas.gov: Hello OS Version: Windows 2000 Tomcat version:5.5.17 Initial Memory Pool: 768 Maximum Memory Pool:1024 Java Version: Java\jdk1.5.0_14 When we restart the tomcat service our tomcat memory is about 120Mb. It keeps going up over the next few days util it reaches 700Mb and we have to reboot the server. We do not see any errors just yet but the server gets close to maxing out I have questions around garbage collection for tomcat Questions: 1.We do not see the memory going down for the tomcat service. Shouldn't the memory go down as well as up over this timespan 2.Should the memory get to maximum 768Mb and then go back down or get recycled? 3.Is this a bug or what is normal behavior for the tomcat memory? 4.. How do we implement garbage collection for our windows server(-Xincgc)? I am very new to Tomcat and trying to manage/decrease the memory footprint used by Tomcat? Your help is most appreciated... Thanks trevin.john...@occ.treas.gov - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: Tomcat Memory and Garbage Collection questions...
I hope Mr. Caldarale answered your question, because you may otherwise be looking at the 800lb Gorilla in the room. Memory problems within Tomcat could be a number of very hard to see things, but some quick candidates are: * Programmers caching too much data from the DB (or file system) into context attributes * Programmers using context attributes to store session data * Programmers pushing too much data into session attributes * Session timeout is set too high and sessions aren't timing out -Original Message- From: Johnson, Trevin (Contractor) [mailto:trevin.john...@occ.treas.gov] Sent: Monday, November 02, 2009 2:53 PM To: 'users@tomcat.apache.org' Subject: Tomcat Memory and Garbage Collection questions... Hello OS Version: Windows 2000 Tomcat version:5.5.17 Initial Memory Pool: 768 Maximum Memory Pool:1024 Java Version: Java\jdk1.5.0_14 When we restart the tomcat service our tomcat memory is about 120Mb. It keeps going up over the next few days util it reaches 700Mb and we have to reboot the server. We do not see any errors just yet but the server gets close to maxing out I have questions around garbage collection for tomcat Questions: 1.We do not see the memory going down for the tomcat service. Shouldn't the memory go down as well as up over this timespan 2.Should the memory get to maximum 768Mb and then go back down or get recycled? 3.Is this a bug or what is normal behavior for the tomcat memory? 4.. How do we implement garbage collection for our windows server(-Xincgc)? I am very new to Tomcat and trying to manage/decrease the memory footprint used by Tomcat? Your help is most appreciated... Thanks trevin.john...@occ.treas.gov - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Tomcat Memory and Garbage Collection questions...
A question: Do you guys use hot deployment of applications? If you do *not*, then Joseph’s tips are the first things to look at, in short it is the application code keeping too many references. If you do hot deployment, then the number of possibilities goes up significantly. Now you are also talking about references to class loaders and memory cleanup at shutdown, which is another topic altogether. E On Mon, Nov 2, 2009 at 1:44 PM, Joseph Morgan joseph.mor...@ignitesales.com wrote: I hope Mr. Caldarale answered your question, because you may otherwise be looking at the 800lb Gorilla in the room. Memory problems within Tomcat could be a number of very hard to see things, but some quick candidates are: * Programmers caching too much data from the DB (or file system) into context attributes * Programmers using context attributes to store session data * Programmers pushing too much data into session attributes * Session timeout is set too high and sessions aren't timing out
Tomcat Memory Script
Do you know where I can find a shell script (not a jsp) that will monitor the JVM and get me the same information as the Tomcat Manager does (free, max, total)? I am monitorijng a cluster of tomcats and need to keep track of the free memory over time. I have been looking for one and so far have been unsuccessful. Any suggestions? Thanks, Matt
Re: Tomcat Memory Script
Matt Corban wrote: Do you know where I can find a shell script (not a jsp) that will monitor the JVM and get me the same information as the Tomcat Manager does (free, max, total)? I am monitorijng a cluster of tomcats and need to keep track of the free memory over time. I have been looking for one and so far have been unsuccessful. Any suggestions? Not sure it's exactly what you are looking for, but you may want to have a look at this : http://code.google.com/p/jmxsh/ - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Tomcat Memory Script
André Warnier wrote: Matt Corban wrote: Do you know where I can find a shell script (not a jsp) that will monitor the JVM and get me the same information as the Tomcat Manager does (free, max, total)? I am monitorijng a cluster of tomcats and need to keep track of the free memory over time. I have been looking for one and so far have been unsuccessful. Any suggestions? Not sure it's exactly what you are looking for, but you may want to have a look at this : http://code.google.com/p/jmxsh/ - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org Like: java/bin/jmap java/bin/jstack java/bin/jinfo ? p - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Tomcat Memory Script
I am not too familiar with jmap, jstack or jinfo. I could write a script that uses jmap to get the memory of the tomcat running and then store the necessary information in a log file. On Tue, Jun 16, 2009 at 12:39 PM, Pid p...@pidster.com wrote: André Warnier wrote: Matt Corban wrote: Do you know where I can find a shell script (not a jsp) that will monitor the JVM and get me the same information as the Tomcat Manager does (free, max, total)? I am monitorijng a cluster of tomcats and need to keep track of the free memory over time. I have been looking for one and so far have been unsuccessful. Any suggestions? Not sure it's exactly what you are looking for, but you may want to have a look at this : http://code.google.com/p/jmxsh/ - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org Like: java/bin/jmap java/bin/jstack java/bin/jinfo ? p - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Tomcat Memory Script
Dear Matt, I am not too familiar with jmap, jstack or jinfo. I could write a script that uses jmap to get the memory of the tomcat running and then store the necessary information in a log file. That is an option, or you could use a tool that does that for you, plus make nice graphs. Check out http://java-monitor.com and see http://java-monitor.com/forum/livedemo.php for a live demo. It should take you about five minutes to set up. If it takes you longer, I'd love to hear why. :-) -- Kees Jan http://java-monitor.com/forum/ kjkos...@kjkoster.org 06-51838192 Change is good. Granted, it is good in retrospect, but change is good. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Tomcat Memory Leaks
Diego Rodríguez Martín wrote: Hi, I'm not an expert, but I think Tomcat 4.X is not compatible with JDK 1.5. That is not correct. Tomcat 4.x works quite happily with 1.4, 1.5 and 1.6. I have also had a number of recent versions running on 1.3 and 1.2 JVMs although without extensive testing. Mark - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: tomcat memory leak problem
As stated below profiling (Yourkit is a very good recommendation, you can try their early access version http://www.yourkit.com/eap/index.jsp) will give you more insight in your tomcat application. Sometimes changing your memory / garbage collect parameters can change the world for you. For more insight read: http://www.informit.com/guides/content.aspx?g=javaseqNum=253 http://java.sun.com/docs/hotspot/gc5.0/gc_tuning_5.html Hubert -Original Message- From: Piller Sébastien [mailto:pi...@hmcrecord.ch] Sent: 05 February 2009 17:25 To: Tomcat Users List Subject: Re: tomcat memory leak problem Are you sure you don't have any thread or task (I mean, quartz or so) that is running and consume memory? I agree, this sounds quite strange (our app is running for several weeks and don't have any major issue, we sometimes need to restart tomcat because it hangs, but our memory is under control, and we use lotz of external api like spring, hibernate, wicket, etc.) Could you maybe profile it using Yourkit or any other tool? fcxjp a écrit : My system environment is: Windows 2000 Server. JDK 1.5, tomcat 5.5, Oracle 9 The problems are: 1. After tomcat was started, the memory of the tomcat was normal, about 200M-300M. But after a certain time(this time was not set), the memory began to grow, and the growing speed was so fast that in about 5 minites the maximum would be reached. The difference of this problem with other problems I've checked is, in other problems, the memory growing speed is continual and not so fast, while in our problem the memory didn't grow at the beginning, but after a certain time instead. 2. There is another strange phenomenon here. We restarted tomcat at 23:30 last night. We checked the log at 8:00 this morning and found out the system was not used by anyone during this time. But the memory of tomcat had reached to 1.5G, which is the maximun of tomcat's memory. Later, after some users began to use this system, tomcat' memory dropped to 500M+. How and why was the memory collected? By the way, we have cheched the code for any optimization, including StringBuffer, Vector, datasource connections, etc., which only resulted with a faster response speed for users, not any influence for the memory problem. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
tomcat memory leak problem
My system environment is: Windows 2000 Server. JDK 1.5, tomcat 5.5, Oracle 9 The problems are: 1. After tomcat was started, the memory of the tomcat was normal, about 200M-300M. But after a certain time(this time was not set), the memory began to grow, and the growing speed was so fast that in about 5 minites the maximum would be reached. The difference of this problem with other problems I've checked is, in other problems, the memory growing speed is continual and not so fast, while in our problem the memory didn't grow at the beginning, but after a certain time instead. 2. There is another strange phenomenon here. We restarted tomcat at 23:30 last night. We checked the log at 8:00 this morning and found out the system was not used by anyone during this time. But the memory of tomcat had reached to 1.5G, which is the maximun of tomcat's memory. Later, after some users began to use this system, tomcat' memory dropped to 500M+. How and why was the memory collected? By the way, we have cheched the code for any optimization, including StringBuffer, Vector, datasource connections, etc., which only resulted with a faster response speed for users, not any influence for the memory problem. -- View this message in context: http://www.nabble.com/tomcat-memory-leak-problem-tp21855110p21855110.html Sent from the Tomcat - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: tomcat memory leak problem
Are you sure you don't have any thread or task (I mean, quartz or so) that is running and consume memory? I agree, this sounds quite strange (our app is running for several weeks and don't have any major issue, we sometimes need to restart tomcat because it hangs, but our memory is under control, and we use lotz of external api like spring, hibernate, wicket, etc.) Could you maybe profile it using Yourkit or any other tool? fcxjp a écrit : My system environment is: Windows 2000 Server. JDK 1.5, tomcat 5.5, Oracle 9 The problems are: 1. After tomcat was started, the memory of the tomcat was normal, about 200M-300M. But after a certain time(this time was not set), the memory began to grow, and the growing speed was so fast that in about 5 minites the maximum would be reached. The difference of this problem with other problems I've checked is, in other problems, the memory growing speed is continual and not so fast, while in our problem the memory didn't grow at the beginning, but after a certain time instead. 2. There is another strange phenomenon here. We restarted tomcat at 23:30 last night. We checked the log at 8:00 this morning and found out the system was not used by anyone during this time. But the memory of tomcat had reached to 1.5G, which is the maximun of tomcat's memory. Later, after some users began to use this system, tomcat' memory dropped to 500M+. How and why was the memory collected? By the way, we have cheched the code for any optimization, including StringBuffer, Vector, datasource connections, etc., which only resulted with a faster response speed for users, not any influence for the memory problem. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: tomcat memory leak problem
The problem may be in your web application and not in Tomcat itself. Duplicate your environment and use a memory profiler. (like the one included with Netbeans) Or use the extended JVM options to produce a HeapDump -Original Message- From: fcxjp [mailto:fc...@163.com] Sent: Thursday, February 05, 2009 11:14 AM To: users@tomcat.apache.org Subject: tomcat memory leak problem My system environment is: Windows 2000 Server. JDK 1.5, tomcat 5.5, Oracle 9 The problems are: 1. After tomcat was started, the memory of the tomcat was normal, about 200M-300M. But after a certain time(this time was not set), the memory began to grow, and the growing speed was so fast that in about 5 minites the maximum would be reached. The difference of this problem with other problems I've checked is, in other problems, the memory growing speed is continual and not so fast, while in our problem the memory didn't grow at the beginning, but after a certain time instead. 2. There is another strange phenomenon here. We restarted tomcat at 23:30 last night. We checked the log at 8:00 this morning and found out the system was not used by anyone during this time. But the memory of tomcat had reached to 1.5G, which is the maximun of tomcat's memory. Later, after some users began to use this system, tomcat' memory dropped to 500M+. How and why was the memory collected? By the way, we have cheched the code for any optimization, including StringBuffer, Vector, datasource connections, etc., which only resulted with a faster response speed for users, not any influence for the memory problem. -- View this message in context: http://www.nabble.com/tomcat-memory-leak-problem-tp21855110p21855110.htm l Sent from the Tomcat - User mailing list archive at Nabble.com. - 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: Understanding Tomcat Memory Utilization
From: Robinson, Eric [mailto:eric.robin...@psmnv.com] Subject: Understanding Tomcat Memory Utilization Can someone help me understand why tomcat is configured to use 64MB, but claims to peak at 48MB Because that's all it needs to initialize. Unless you set -Xms == -Xmx, the JVM starts out with a smaller heap than the max, and even after the max has been reached, it may shrink the heap size back down if it can. but has resident size of 147MB, and a virtual size of 256MB, while other instances of tomcat have java processes with a resident size of 32MB? Welcome to paging. The Linux memory subsystem will swap out least recently used pages when needed to make room for others. I suspect the ones with the smaller resident sizes initialized first, went idle, and some of their memory was swapped out to make room for the later ones. If you're not seeing paging activity during heavy loads, you're fine. If you are, you'll need to increase the amount of RAM on the system, since you're not going to be able to decrease the JVM heap sizes to any significant degree (64 MB is pretty small these days). - 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
Understanding Tomcat Memory Utilization
We have 60 instances of tomcat 5.X running on an RHEL4 server. Each instance runs a copy of basically the same application, each for a different customer. According to their respective status pages, the tomcats are all configured to use a maximum of 64MB memory, but most peak at around 48MB. However, in 'top' I see that all of the java processes have a virtual image size of approximately 256MB. The resident sizes of the java processes vary wildly from 32MB to 147MB. Can someone help me understand why tomcat is configured to use 64MB, but claims to peak at 48MB, but has resident size of 147MB, and a virtual size of 256MB, while other instances of tomcat have java processes with a resident size of 32MB? Note that these numbers were captured in the middle of the night, after all tomcats had been restarted, and nobody is using the system. --Eric Disclaimer - December 15, 2008 This email and any files transmitted with it are confidential and intended solely for Tomcat Users List,Tomcat Users List. If you are not the named addressee you should not disseminate, distribute, copy or alter this email. Any views or opinions presented in this email are solely those of the author and might not represent those of . Warning: Although has taken reasonable precautions to ensure no viruses are present in this email, the company cannot accept responsibility for any loss or damage arising from the use of this email or attachments. This disclaimer was added by Policy Patrol: http://www.policypatrol.com/ - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: Understanding Tomcat Memory Utilization
Welcome to paging. I understand the difference between virtual image size and resident size. The part I don't understand is the relationship between the tomcat memory configuration as reported by the tomcat status page and the actual usage as reported by top. Tomcat says it is configured to use a maximum of 64MB, but top indicates the residant size is twice that and the virtual image size is four times that. -- Eric Disclaimer - December 15, 2008 This email and any files transmitted with it are confidential and intended solely for Tomcat Users List. If you are not the named addressee you should not disseminate, distribute, copy or alter this email. Any views or opinions presented in this email are solely those of the author and might not represent those of . Warning: Although has taken reasonable precautions to ensure no viruses are present in this email, the company cannot accept responsibility for any loss or damage arising from the use of this email or attachments. This disclaimer was added by Policy Patrol: http://www.policypatrol.com/ - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: Understanding Tomcat Memory Utilization
Welcome to paging. I understand the difference between resident size and virtual image. What I don't understand is why the tomcat status page indicates that tomcat is configured to use a maximum of 64MB, but the resident size is twice that and the virual image is four times that. In other words, I don't see a relationship between the tomcat memory configuration setting and what actually gets used. -- Eric Robinson Disclaimer - December 15, 2008 This email and any files transmitted with it are confidential and intended solely for Tomcat Users List. If you are not the named addressee you should not disseminate, distribute, copy or alter this email. Any views or opinions presented in this email are solely those of the author and might not represent those of . Warning: Although has taken reasonable precautions to ensure no viruses are present in this email, the company cannot accept responsibility for any loss or damage arising from the use of this email or attachments. This disclaimer was added by Policy Patrol: http://www.policypatrol.com/ - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: Understanding Tomcat Memory Utilization
From: Robinson, Eric [mailto:eric.robin...@psmnv.com] Subject: RE: Understanding Tomcat Memory Utilization Tomcat says it is configured to use a maximum of 64MB That's 64 MB for the *Java heap*, not the entire process. The process space includes lots of other things besides the Java heap, such as room for code, the C heap, other JVM structures, file maps, various bits of OS- and library-managed structures, etc. but top indicates the residant size is twice that and the virtual image size is four times that. Resident should always be = virtual (unless your OS is very strange), and virtual will always be Java heap. - 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: Understanding Tomcat Memory Utilization
That's 64 MB for the *Java heap*, not the entire process. Thanks, that's what I didn't know. -- Eric Disclaimer - December 15, 2008 This email and any files transmitted with it are confidential and intended solely for Tomcat Users List. If you are not the named addressee you should not disseminate, distribute, copy or alter this email. Any views or opinions presented in this email are solely those of the author and might not represent those of . Warning: Although has taken reasonable precautions to ensure no viruses are present in this email, the company cannot accept responsibility for any loss or damage arising from the use of this email or attachments. This disclaimer was added by Policy Patrol: http://www.policypatrol.com/ - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Question regarding Tomcat memory
On Friday 14 November 2008 21:01:40 Caldarale, Charles R wrote: $CATALINA_OPTS -Xms8192M -Xmx8192M -Xss1024K Setting -Xss is usually not useful, unless your application is very, very strange. AFAIK the default stack size of the JVM on 64bit linux is 2M. This is very large, and most apps don't need this much, unless they use deeply recursive algorithms. Setting Xss to a lower value reduces memory footprint of a single thread, and thus allows for more threads and/or larger heap with same amount of physical memory. Regards Rainer Frey -- Software Developer -- Inxmail GmbH Wentzingerstr. 21, 79106 Freiburg, Germany Tel: +49 761 296979-0, Fax: -9 [EMAIL PROTECTED], www.inxmail.de Handelsregister Freiburg, HRB 5870 Ust.-ID: DE198371679 Geschäftsleitung: Martin Bucher, Peter Ziras -- Inxmail Professional kostenlos testen: http://www.inxmail.de/jetzt-testen Tipps und Tricks für E-Mail-Marketers: http://www.inxmail.de/newsletter - 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: Question regarding Tomcat memory
From: Rainer Frey (Inxmail GmbH) [mailto:[EMAIL PROTECTED] Subject: Re: Question regarding Tomcat memory AFAIK the default stack size of the JVM on 64bit linux is 2M. No, it's 1M for Linux (and Solaris) on AMD64 (at least on JDK 6u7) - the same as the OP was trying to set. For Linux IA64 and Windows AMD64, the system default is used. Setting Xss to a lower value reduces memory footprint of a single thread, and thus allows for more threads and/or larger heap with same amount of physical memory. While true in theory, it's all virtual space, not RAM, so there's no additional contention for pages of physical memory. The size of the process space in 64-bit Linux is so huge that you run into the kernel's limit on the number of threads long before the stack size has any impact on the available process space. - 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: Question regarding Tomcat memory
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Chuck, Caldarale, Charles R wrote: I don't know how log4j determines that value AFAIK, Log4j doesn't have any memory-specific memory info logging. The user has to do it themselves. I suspect they are simply using System.getRuntime() and then printing values from there. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkkhgEQACgkQ9CaO5/Lv0PCIJACeMoYWMSQ+Za157tZlTkVoyUVn yc0AniHr3pwj4u9wsYwdktJ5D5zO+r6G =u+oy -END PGP SIGNATURE- - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Question regarding Tomcat memory
Hi, To make our tomcat heap size memory to 8 GB we have set the below=20 settings echo $CATALINA_OPTS -Xms8192M -Xmx8192M -Xss1024K=20 -XX:PermSize=3D64m -XX:MaxPermSize=3D256m -Dfile.encoding=3DCp1252 Please=20 suggest is this ok ? as we are observing the maximum heap size memory for=20 tomcat gets a reduced bit to around 7756736K and it keeps flucatating. Is= =20 this the normal behaviour?. The OS we are using is Linux 8.
RE: Question regarding Tomcat memory
From: Harish S Rathod [mailto:[EMAIL PROTECTED] Subject: Question regarding Tomcat memory First, use a different mailer or send only in plain text; whatever you're using is encoding even standard ASCII characters like =. To make our tomcat heap size memory to 8 GB we have set the below=20 How much RAM and swap space do you have on the system? What JVM are you using? To go over 1.8 GB you need a 64-bit JVM. $CATALINA_OPTS -Xms8192M -Xmx8192M -Xss1024K=20 Setting -Xss is usually not useful, unless your application is very, very strange. as we are observing the maximum heap size memory for tomcat gets a reduced bit to around 7756736K and it keeps flucatating. What are you using to do the observing? When I run JConsole targeting a JVM with the exact settings you specify, it says this about the heap: Committed: 8,039,104 kbytes Max: 8,039,104 kbytes This is on a SuSE 10 system, with JDK 1.6.0_07, in server mode. - 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: Question regarding Tomcat memory
Hi, Sorry the content of the mail was bit messed up ,i have corrected the settings wordings please read the below text To make our tomcat heap size memory to 8 GB we have set the below settings -Xms8192M -Xmx8192M -Xss1024K -XX:PermSize=64m -XX:MaxPermSize=256m -Dfile.encoding=Cp1252 Please suggest is this ok ? as we are observing the maximum heap size memory for tomcat gets a reduced bit to around 7756736K and it keeps flucatating.Is this normal behaviour The OS we are using is Linux 8. - Well we are using 64 bit JDK - We are prinitng the heap mem using Log 4J utitiy in the apllication logs. On Sat, Nov 15, 2008 at 4:01 AM, Caldarale, Charles R [EMAIL PROTECTED] wrote: From: Harish S Rathod [mailto:[EMAIL PROTECTED] Subject: Question regarding Tomcat memory First, use a different mailer or send only in plain text; whatever you're using is encoding even standard ASCII characters like =. To make our tomcat heap size memory to 8 GB we have set the below=20 How much RAM and swap space do you have on the system? What JVM are you using? To go over 1.8 GB you need a 64-bit JVM. $CATALINA_OPTS -Xms8192M -Xmx8192M -Xss1024K=20 Setting -Xss is usually not useful, unless your application is very, very strange. as we are observing the maximum heap size memory for tomcat gets a reduced bit to around 7756736K and it keeps flucatating. What are you using to do the observing? When I run JConsole targeting a JVM with the exact settings you specify, it says this about the heap: Committed: 8,039,104 kbytes Max: 8,039,104 kbytes This is on a SuSE 10 system, with JDK 1.6.0_07, in server mode. - 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: Question regarding Tomcat memory
From: Harish S Rathod [mailto:[EMAIL PROTECTED] Subject: Re: Question regarding Tomcat memory -Xms8192M -Xmx8192M -Xss1024K -XX:PermSize=64m -XX:MaxPermSize=256m -Dfile.encoding=Cp1252 That's what I surmised. Please suggest is this ok ? As long as you have the RAM to hold that much heap (plus the other memory required by the process), it should be o.k. If you don't have at least 9 GB of RAM, you're going to be paging like mad, which will absolutely kill performance. Again, setting -Xss is usually pointless. I would set PermSize to the same value as MaxPermSize, just to avoid unnecessary expansion and contraction of the PermGen. - Well we are using 64 bit JDK Which one? - We are prinitng the heap mem using Log 4J utitiy in the apllication logs. I don't know how log4j determines that value; what is shown by JConsole or LambdaProbe? (The latter can be found at www.lambdaprobe.org.) - 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]
Tomcat memory increasing without any activity on our webapp
Hello all, We have a Spring webapp running in a Tomcat 5.5 (5.5.7 or 5.5.25 depending upon the machines). When we start it up without any surfing on it or without any activity of any kind, the JVM memory first goes to some level, then stays at this level for 5-10 minutes and after some times it keeps on growing up. BUT, if we set up this webapp as non-reloadable (on a dev machine), the memory just grows up in the beginning and then doesn't grow up anymore, as one or at least me should expect. Does anyone has an idea regarding the cause of this behavior ? Is there anything we could do ? Of course, our production environment is set up for non-reloadable webapps but I see this behaviour as surprising. Regards, Pierre -- Je n'ai pas de maître, je suis le chaos.
RE: Tomcat memory increasing without any activity on our webapp
From: Pierre Goupil [mailto:[EMAIL PROTECTED] Subject: Tomcat memory increasing without any activity on our webapp When we start it up without any surfing on it or without any activity of any kind, the JVM memory first goes to some level, then stays at this level for 5-10 minutes and after some times it keeps on growing up. BUT, if we set up this webapp as non-reloadable (on a dev machine), the memory just grows up in the beginning and then doesn't grow up anymore There are many definitions of memory; which one are you referring to? What does JConsole (or equivalent) say about heap usage? What OS are you using? Which JVM? What are your Java heap size settings? The thread that monitors webapps for potential reloading will create objects as it runs, and these won't go away until a garbage collection occurs. In a lightly loaded system, that may not happen for several days. - 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]
Any application which is use to detect tomcat memory leak problem
Hi Gurus, Is there any application which I may use to detect tomcat memory leak problem? Thank you in advance for any value input. Thanks Regards. Get your new Email address! Grab the Email name you#39;ve always wanted before someone else does! http://mail.promotions.yahoo.com/newdomains/sg/ - 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: Any application which is use to detect tomcat memory leak problem
Hello Nix Are you looking for a memory leak in your web application or in tomcat? Short answer is it's not easy. The garbage collection mechanism in the JVM will cleanup any objects that are no longer referenced. Therefore, you are only concerned with objects that remain referenced (which in an ideal world should be relatively few). To test if your app is indeed exponentially increasing, you could start the JVM with the -Xverbose:gc option and watch the output for a while. If not, a good (commercial) tool is JProbe http://www.quest.com/jprobe/memory-home.aspx Regards Tom On 23/06/2008, at 12:17 PM, Nix Hanwei wrote: Hi Gurus, Is there any application which I may use to detect tomcat memory leak problem? Thank you in advance for any value input. Thanks Regards. - 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: Any application which is use to detect tomcat memory leak problem
One of the things I had done in my past projects was to run a thread which periodically executes the freeMemory /totalMemory methods on Runtime class in JVM, this will at least tell you how the memory is utilised, but pinpointing the leak may need a commercial tool. -Sameer --- On Mon, 6/23/08, Nix Hanwei [EMAIL PROTECTED] wrote: From: Nix Hanwei [EMAIL PROTECTED] Subject: Any application which is use to detect tomcat memory leak problem To: Tomcat Users List users@tomcat.apache.org Date: Monday, June 23, 2008, 9:47 AM Hi Gurus, Is there any application which I may use to detect tomcat memory leak problem? Thank you in advance for any value input. Thanks Regards. Get your new Email address! Grab the Email name you#39;ve always wanted before someone else does! http://mail.promotions.yahoo.com/newdomains/sg/ - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
How to increase tomcat memory
Hi here it comes my question again... :D How to increase tomcat memory? I'm getting GC overhead limit exceeded. I tried putting export JAVA_OPTS=-Xms256m -Xmx512m in setclasspath.sh file as well as putting CATALINA_OPTS=-server -Xms256m -Xmx512m in /etc/init.d/tomcat5.5 script file, but when I go to tomcat administration webpage and list the server status I always get Max memory: 113.81 MB. Thank you very much -- Un saludo, Tomás Tormo Franco Indenova, S.L. Tels.: +34 963 81 99 47 http://www.indenova.com mailto:[EMAIL PROTECTED] - 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: How to increase tomcat memory
You seem to be using linux. If you go: ps alx | grep java after you have started tomcat you should be able to find the invocation for tomcat. Please check to see whether or not the options you have specified below appear in that list and check very carefully that there is whitespace around the options. I would look for two things were I debugging this: 1. The option isn't being included in the tomcat java invocation 2. The option is corrupted (misspelt, incorrect spacing etc). HTH Alan Chaney Tomás Tormo wrote: Hi here it comes my question again... :D How to increase tomcat memory? I'm getting GC overhead limit exceeded. I tried putting export JAVA_OPTS=-Xms256m -Xmx512m in setclasspath.sh file as well as putting CATALINA_OPTS=-server -Xms256m -Xmx512m in /etc/init.d/tomcat5.5 script file, but when I go to tomcat administration webpage and list the server status I always get Max memory: 113.81 MB. Thank you very much - 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: *SPAM* Re: How to increase tomcat memory
Thank you very much for you answer. Because of I was in a hurry, I examined the invocation of tomcat and I found that Tomcat was using 128mb of memory, so, obviously , the lines I added weren't working at all... Then, I realized that the -Xmx128m argument was after a line -Djava.awt.headless=true, so I simply located that line (that can be found in catalina.sh) and changed the argument with -Xmx512m, and now my applicattion is working perfectly :) Anyway... does anybody know the correct way to do this? (or maybe, this is the good one... :p ) Thank you again! Alan Chaney escribió: You seem to be using linux. If you go: ps alx | grep java after you have started tomcat you should be able to find the invocation for tomcat. Please check to see whether or not the options you have specified below appear in that list and check very carefully that there is whitespace around the options. I would look for two things were I debugging this: 1. The option isn't being included in the tomcat java invocation 2. The option is corrupted (misspelt, incorrect spacing etc). HTH Alan Chaney Tomás Tormo wrote: Hi here it comes my question again... :D How to increase tomcat memory? I'm getting GC overhead limit exceeded. I tried putting export JAVA_OPTS=-Xms256m -Xmx512m in setclasspath.sh file as well as putting CATALINA_OPTS=-server -Xms256m -Xmx512m in /etc/init.d/tomcat5.5 script file, but when I go to tomcat administration webpage and list the server status I always get Max memory: 113.81 MB. Thank you very much - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Un saludo, Tomás Tormo Franco Indenova, S.L. Tels.: +34 963 81 99 47 http://www.indenova.com mailto:[EMAIL PROTECTED] - 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: *SPAM* Re: How to increase tomcat memory
Sorry, the file i edited was the one in /etc/init.d/tomcatX (where X is the version of Tomcat) too much working.. :D Greetings! Tomás Tormo escribió: Thank you very much for you answer. Because of I was in a hurry, I examined the invocation of tomcat and I found that Tomcat was using 128mb of memory, so, obviously , the lines I added weren't working at all... Then, I realized that the -Xmx128m argument was after a line -Djava.awt.headless=true, so I simply located that line (that can be found in catalina.sh) and changed the argument with -Xmx512m, and now my applicattion is working perfectly :) Anyway... does anybody know the correct way to do this? (or maybe, this is the good one... :p ) Thank you again! Alan Chaney escribió: You seem to be using linux. If you go: ps alx | grep java after you have started tomcat you should be able to find the invocation for tomcat. Please check to see whether or not the options you have specified below appear in that list and check very carefully that there is whitespace around the options. I would look for two things were I debugging this: 1. The option isn't being included in the tomcat java invocation 2. The option is corrupted (misspelt, incorrect spacing etc). HTH Alan Chaney Tomás Tormo wrote: Hi here it comes my question again... :D How to increase tomcat memory? I'm getting GC overhead limit exceeded. I tried putting export JAVA_OPTS=-Xms256m -Xmx512m in setclasspath.sh file as well as putting CATALINA_OPTS=-server -Xms256m -Xmx512m in /etc/init.d/tomcat5.5 script file, but when I go to tomcat administration webpage and list the server status I always get Max memory: 113.81 MB. Thank you very much - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Un saludo, Tomás Tormo Franco Indenova, S.L. Tels.: +34 963 81 99 47 http://www.indenova.com mailto:[EMAIL PROTECTED] - 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: *SPAM* Re: How to increase tomcat memory
/etc/init.d/tomcatX is not a file provided by any packages from tomcat.apache.org. I would suspect it's probably the best place for your adjustments when launching tomcat as a service -- especially since it already contained -Xmx128m. Check documentation provided by the packager to get an authoritative answer though. --David Tomás Tormo wrote: Sorry, the file i edited was the one in /etc/init.d/tomcatX (where X is the version of Tomcat) too much working.. :D Greetings! Tomás Tormo escribió: Thank you very much for you answer. Because of I was in a hurry, I examined the invocation of tomcat and I found that Tomcat was using 128mb of memory, so, obviously , the lines I added weren't working at all... Then, I realized that the -Xmx128m argument was after a line -Djava.awt.headless=true, so I simply located that line (that can be found in catalina.sh) and changed the argument with -Xmx512m, and now my applicattion is working perfectly :) Anyway... does anybody know the correct way to do this? (or maybe, this is the good one... :p ) Thank you again! Alan Chaney escribió: You seem to be using linux. If you go: ps alx | grep java after you have started tomcat you should be able to find the invocation for tomcat. Please check to see whether or not the options you have specified below appear in that list and check very carefully that there is whitespace around the options. I would look for two things were I debugging this: 1. The option isn't being included in the tomcat java invocation 2. The option is corrupted (misspelt, incorrect spacing etc). HTH Alan Chaney Tomás Tormo wrote: Hi here it comes my question again... :D How to increase tomcat memory? I'm getting GC overhead limit exceeded. I tried putting export JAVA_OPTS=-Xms256m -Xmx512m in setclasspath.sh file as well as putting CATALINA_OPTS=-server -Xms256m -Xmx512m in /etc/init.d/tomcat5.5 script file, but when I go to tomcat administration webpage and list the server status I always get Max memory: 113.81 MB. Thank you very much - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]