Re: Tomcat 4.1.12 memory leak, resources leak, what to do ?
Thanks to all that have replied, the problem is still here and what follows are the tests I did To clear the issue here it is what I am doing -- - Clean install of redhat 7.2 or Suse 7.1 (same results for both platforms) - Clean installation of tomcat 4.1.12 - Clean installation if JDK 1.4.1 (the same happens with 1.4.0.2 or 1.3.1) - What I am doing is http://localhost:8080/ and keep refreshing that with F5 - I am NOT testing my own servlet. I am NOT doing anything else !!! I monitor memory usage using top and sorting the results by memory. I am looking at the SIZE column. What I get is an EVER INCREASING memory usage. Something like 30212 30220 31016 31040 31576 - I did try the various suggestions and as far as I can tell it is not a pure memory issue but it probably is a resource issue, maybe a file not closed or a socket ... The question, what should I do next ? Who should I report the problem to ? I must say that it is very easy to reproduce. Damiano At 20.11 26/09/2002 -0500, you wrote: The easiest way to track JVM garbage collection is to start java with the -verbose:gc arg. This enables GC data output to stdout. Regards, Glenn Raj Saini wrote: I am experiencing the same problem with tomcat 4.0.3. I have my JVM memory setting as -Xms=32 -Xmx=384 and running the tomcat on Sun Solaris 2.7, integrated with Apache 1.3.x through warp connector. I have a JSP page monitoring the memory consumption at http://www.emerging-trade.pt/servlets/memory.jsp, The memory consumption pattern of the JSP shows the GC runs as you can see the increase/decerece in the free memory of the current heap size. Raj Saini Raj Saini - Original Message - From: Tim Funk [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Thursday, September 26, 2002 2:29 PM Subject: Re: Tomcat 4.1.12 memory leak Each request allocates memory. (And relinquishes accordingly) The garbage collector runs when it feels like it should. The JVM will continually suck up memory until it reaches its startup parameters. (-mx ...) Once a JVM takes memory from the OS - it does not release it to the OS - it only releases it to its own memory heap. Ing. Damiano Bolla wrote: System: Linux redhat 7.2 Java: /usr/local/j2sdk1.3.1 Tomcat 4.1.12 To reproduce the behaviour you install the 4.1.12 distribution, set the JAVA_HOME run startup.sh and then keep refreshing the homepage http://localhost:8080/ If you monitor the memory usage using top and switching it into display memory usage (Capital M) you sull see tipically something like 22824 22832 22840 23576 23676 23684 23904 23908 23934 23938 . This is the SIZE field of the top command. The point is that it never goes down and eventually you run very slowly. Any idea ? Ah, the same behaviour is with jdk 1.4.1 Damiano -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Tomcat 4.1.12 memory leak, resources leak, what to do ?
post it as a bug to http://nagoya.apache.org/bugzilla/ Charlie -Original Message- From: Ing. Damiano Bolla [mailto:[EMAIL PROTECTED]] Sent: Friday, September 27, 2002 6:19 AM To: Tomcat Users List Subject: Re: Tomcat 4.1.12 memory leak, resources leak, what to do ? Thanks to all that have replied, the problem is still here and what follows are the tests I did To clear the issue here it is what I am doing -- - Clean install of redhat 7.2 or Suse 7.1 (same results for both platforms) - Clean installation of tomcat 4.1.12 - Clean installation if JDK 1.4.1 (the same happens with 1.4.0.2 or 1.3.1) - What I am doing is http://localhost:8080/ and keep refreshing that with F5 - I am NOT testing my own servlet. I am NOT doing anything else !!! I monitor memory usage using top and sorting the results by memory. I am looking at the SIZE column. What I get is an EVER INCREASING memory usage. Something like 30212 30220 31016 31040 31576 - I did try the various suggestions and as far as I can tell it is not a pure memory issue but it probably is a resource issue, maybe a file not closed or a socket ... The question, what should I do next ? Who should I report the problem to ? I must say that it is very easy to reproduce. Damiano At 20.11 26/09/2002 -0500, you wrote: The easiest way to track JVM garbage collection is to start java with the -verbose:gc arg. This enables GC data output to stdout. Regards, Glenn Raj Saini wrote: I am experiencing the same problem with tomcat 4.0.3. I have my JVM memory setting as -Xms=32 -Xmx=384 and running the tomcat on Sun Solaris 2.7, integrated with Apache 1.3.x through warp connector. I have a JSP page monitoring the memory consumption at http://www.emerging-trade.pt/servlets/memory.jsp, The memory consumption pattern of the JSP shows the GC runs as you can see the increase/decerece in the free memory of the current heap size. Raj Saini Raj Saini - Original Message - From: Tim Funk [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Thursday, September 26, 2002 2:29 PM Subject: Re: Tomcat 4.1.12 memory leak Each request allocates memory. (And relinquishes accordingly) The garbage collector runs when it feels like it should. The JVM will continually suck up memory until it reaches its startup parameters. (-mx ...) Once a JVM takes memory from the OS - it does not release it to the OS - it only releases it to its own memory heap. Ing. Damiano Bolla wrote: System: Linux redhat 7.2 Java: /usr/local/j2sdk1.3.1 Tomcat 4.1.12 To reproduce the behaviour you install the 4.1.12 distribution, set the JAVA_HOME run startup.sh and then keep refreshing the homepage http://localhost:8080/ If you monitor the memory usage using top and switching it into display memory usage (Capital M) you sull see tipically something like 22824 22832 22840 23576 23676 23684 23904 23908 23934 23938 . This is the SIZE field of the top command. The point is that it never goes down and eventually you run very slowly. Any idea ? Ah, the same behaviour is with jdk 1.4.1 Damiano -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Tomcat 4.1.12 memory leak, resources leak, what to do ?
out of curiousity, have you tried it with jdk1.4.0? it could be there's a memory leak with jdk1.4.1. You may also want to check Sun's java bug database to see if there isn't already a bug reported related to your findings. peter lin -Original Message- From: Ing. Damiano Bolla [mailto:[EMAIL PROTECTED]] Sent: Friday, September 27, 2002 6:19 AM To: Tomcat Users List Subject: Re: Tomcat 4.1.12 memory leak, resources leak, what to do ? Thanks to all that have replied, the problem is still here and what follows are the tests I did To clear the issue here it is what I am doing -- - Clean install of redhat 7.2 or Suse 7.1 (same results for both platforms) - Clean installation of tomcat 4.1.12 - Clean installation if JDK 1.4.1 (the same happens with 1.4.0.2 or 1.3.1) - What I am doing is http://localhost:8080/ and keep refreshing that with F5 - I am NOT testing my own servlet. I am NOT doing anything else !!! I monitor memory usage using top and sorting the results by memory. I am looking at the SIZE column. What I get is an EVER INCREASING memory usage. Something like 30212 30220 31016 31040 31576 - I did try the various suggestions and as far as I can tell it is not a pure memory issue but it probably is a resource issue, maybe a file not closed or a socket ... The question, what should I do next ? Who should I report the problem to ? I must say that it is very easy to reproduce. Damiano -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Tomcat 4.1.12 memory leak, resources leak, what to do ?
Hi, - What I am doing is http://localhost:8080/ and keep refreshing that with F5 - I am NOT testing my own servlet. I am NOT doing anything else !!! I monitor memory usage using top and sorting the results by memory. I am looking at the SIZE column. What I get is an EVER INCREASING memory usage. Something like 30212 30220 31016 31040 31576 Why is that necessarily a leak??? The JVM will allocate as much memory as it wants even for identical resources, up to when a GC is needed. As long as this is all you're doing, it could go up to close to 64MB (the default limit), before everything will be GCed. Did you try going up that high? I wouldn't rush to put in a bug for this ;) Yoav Shapira Millennium ChemInformatics This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Tomcat 4.1.12 memory leak, resources leak, what to do ?
Yes, I did let it run and it keeps eating. I have other production systems that exibit the problem and they need rebooting. In any case, did any of you tried what I did ? If you have not, then please do not comment.. If you have and everything is fine, then please tell me what setup you are using. As far as I see this IS a problem. Thanks. P.S. Asking for help at bugzilla had no effect. At 09.02 27/09/2002 -0400, you wrote: content-class: urn:content-classes:message Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi, - What I am doing is http://localhost:8080/ and keep refreshing that with F5 - I am NOT testing my own servlet. I am NOT doing anything else !!! I monitor memory usage using top and sorting the results by memory. I am looking at the SIZE column. What I get is an EVER INCREASING memory usage. Something like 30212 30220 31016 31040 31576 Why is that necessarily a leak??? The JVM will allocate as much memory as it wants even for identical resources, up to when a GC is needed. As long as this is all you're doing, it could go up to close to 64MB (the default limit), before everything will be GCed. Did you try going up that high? I wouldn't rush to put in a bug for this ;) Yoav Shapira Millennium ChemInformatics This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Tomcat 4.1.12 memory leak, resources leak, what to do ?
Asking for help at bugzilla did have an effect. The dev team told you they have read these posts and do not feel it is a bug. If you realy think it is a bug d/l the source and find it and submit a patch. -Original Message- From: Ing. Damiano Bolla [mailto:[EMAIL PROTECTED]] Sent: Friday, September 27, 2002 10:13 AM To: Tomcat Users List Subject: RE: Tomcat 4.1.12 memory leak, resources leak, what to do ? Yes, I did let it run and it keeps eating. I have other production systems that exibit the problem and they need rebooting. In any case, did any of you tried what I did ? If you have not, then please do not comment.. If you have and everything is fine, then please tell me what setup you are using. As far as I see this IS a problem. Thanks. P.S. Asking for help at bugzilla had no effect. At 09.02 27/09/2002 -0400, you wrote: content-class: urn:content-classes:message Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi, - What I am doing is http://localhost:8080/ and keep refreshing that with F5 - I am NOT testing my own servlet. I am NOT doing anything else !!! I monitor memory usage using top and sorting the results by memory. I am looking at the SIZE column. What I get is an EVER INCREASING memory usage. Something like 30212 30220 31016 31040 31576 Why is that necessarily a leak??? The JVM will allocate as much memory as it wants even for identical resources, up to when a GC is needed. As long as this is all you're doing, it could go up to close to 64MB (the default limit), before everything will be GCed. Did you try going up that high? I wouldn't rush to put in a bug for this ;) Yoav Shapira Millennium ChemInformatics This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. -- To unsubscribe, e-mail: mailto:tomcat-user- [EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:tomcat-user- [EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Tomcat 4.1.12 memory leak, resources leak, what to do ?
I'm running stress testing right now on 4.1.12 with jdk1.4.0. I see no memory leak problems with a real webapp that uses a ton of jstl tags. I've run it with both -Xmx128 and without. I'm guessing the culprit is something else. one suggestion is to run a super simple stand alone java program and have it run for 30 minutes. If you see a memory leak, then you know the problem isn't with tomcat. if you haven't tried running a java program with verbose GC, you really should consider trying that to see if any patterns emerge. If you see the same number of objects garbaged, but the heap grows steadily that is normal. On the other hand, if the number of objects garbaged is low and decreases with time, then you know there's a leak some place. the problem is only going to solved if you put in real effort to help diagnose it. peter Ing. Damiano Bolla wrote: Yes, I did let it run and it keeps eating. I have other production systems that exibit the problem and they need rebooting. In any case, did any of you tried what I did ? If you have not, then please do not comment.. If you have and everything is fine, then please tell me what setup you are using. As far as I see this IS a problem. Thanks. P.S. Asking for help at bugzilla had no effect. At 09.02 27/09/2002 -0400, you wrote: content-class: urn:content-classes:message Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi, - What I am doing is http://localhost:8080/ and keep refreshing that with F5 - I am NOT testing my own servlet. I am NOT doing anything else !!! I monitor memory usage using top and sorting the results by memory. I am looking at the SIZE column. What I get is an EVER INCREASING memory usage. Something like 30212 30220 31016 31040 31576 Why is that necessarily a leak??? The JVM will allocate as much memory as it wants even for identical resources, up to when a GC is needed. As long as this is all you're doing, it could go up to close to 64MB (the default limit), before everything will be GCed. Did you try going up that high? I wouldn't rush to put in a bug for this ;) Yoav Shapira Millennium ChemInformatics This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
AW: Tomcat 4.1.12 memory leak, resources leak, what to do ?
- The memory that a vm uses is never decreasing (At least I don't know any that behave that way) To understand that you have to see two different things: - the memory that is used by the vm - the memory inside the vm All vm's that I know, don't return memory to the os. What happens during a gc is just that inside the vm the memory is marked as free. So the only save indicators for the question 'how many memory is currently in use' are the methods java.lang.Runtime.get*Memory. - To a certain degree it is normal that the memory is increasing. Reasons for that: - each session needs some memory, that is only released after the session has timed out. If you create sessions very fast this can consume quite some memory. (If you are creating the sessions faster as they dye tomcat will die with an out of memory error.) - Just because an object isn't used anymore , is dosn't mean that the memory that is consumed by it is freed. This just happens, when the garbage collector runs. When this will happen, is up to the VM. Until then the memory will grow. There is nothing you (or tomcat) can do about that from inside the application. The only action that has affect, is to play with the various parameters for the garbage collector as argument to the java process. So what can you do, to track the problem down: - Make shure that the request don't create new sessions. (There are several routes how to achieve that) - Strip the page that you test down to a minmal jsp. (I haven't seen in your previous posts that you say anything about the nature of this page) - Track the memory usage with java.lang.Runtime.get*Memory() - Use the java options to achieve a verbose gc - Set the maximal heap size to a lower bound, to see what happens when this value is reached. - Profile the application with OptimizeIt or jProbe or any other profiler. - show us your page, maybe it's the page that contains the memory leak Sun has some background and advice at: http://java.sun.com/docs/hotspot/gc/ http://java.sun.com/products/hotspot/whitepaper.html Also javaworld: http://www.javaworld.com/javaworld/jw-01-2002/jw-0111-hotspotgc.html Ralph Einfeldt Uptime Internet Solution Center GmbH Hamburg, Germany Hosting, Content Management, Java Consulting http://www.uptime-isc.de -Ursprüngliche Nachricht- Von: Ing. Damiano Bolla [mailto:[EMAIL PROTECTED]] Gesendet: Freitag, 27. September 2002 16:13 An: Tomcat Users List Betreff: RE: Tomcat 4.1.12 memory leak, resources leak, what to do ? Yes, I did let it run and it keeps eating. As far as I see this IS a problem. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: AW: Tomcat 4.1.12 memory leak, resources leak, what to do ?
Ralph Einfeldt wrote: - The memory that a vm uses is never decreasing (At least I don't know any that behave that way) To understand that you have to see two different things: - the memory that is used by the vm - the memory inside the vm All vm's that I know, don't return memory to the os. What happens during a gc is just that inside the vm the memory is marked as free. So the only save indicators for the question 'how many memory is currently in use' are the methods java.lang.Runtime.get*Memory. - To a certain degree it is normal that the memory is increasing. Reasons for that: - each session needs some memory, that is only released after the session has timed out. If you create sessions very fast this can consume quite some memory. (If you are creating the sessions faster as they dye tomcat will die with an out of memory error.) To avoid that, you can either: - use some more scalable manager (JDBC store or similar) - set a maximum amount of active sessions (session creation will be denied after that until some timeout) Remy -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: AW: Tomcat 4.1.12 memory leak, resources leak, final call ?
Let me repeat, once more I am reloading the DEFAULT installation page of tomcat. I am NOT using my own page. I am NOT testing a weird servlet. Just the DEFAULT tomcat page. (the one that comes right after you have installed tomcat) Sorry for the capital letters above, I would like to say that 1) I understand the GC concept and heap, BUT there is something wrong if reloading the same page eats all the ram. 2) Thanks to everybody that are tryng to help, BUT please read the mail before posting a reply. 3) Is there one that does NOT have my same problem by doing EXACTLY what I am doing ? If there is one please send me your setup and I will adopt it. Thanks. At 17.04 27/09/2002 +0200, you wrote: - The memory that a vm uses is never decreasing (At least I don't know any that behave that way) To understand that you have to see two different things: - the memory that is used by the vm - the memory inside the vm All vm's that I know, don't return memory to the os. What happens during a gc is just that inside the vm the memory is marked as free. So the only save indicators for the question 'how many memory is currently in use' are the methods java.lang.Runtime.get*Memory. - To a certain degree it is normal that the memory is increasing. Reasons for that: - each session needs some memory, that is only released after the session has timed out. If you create sessions very fast this can consume quite some memory. (If you are creating the sessions faster as they dye tomcat will die with an out of memory error.) - Just because an object isn't used anymore , is dosn't mean that the memory that is consumed by it is freed. This just happens, when the garbage collector runs. When this will happen, is up to the VM. Until then the memory will grow. There is nothing you (or tomcat) can do about that from inside the application. The only action that has affect, is to play with the various parameters for the garbage collector as argument to the java process. So what can you do, to track the problem down: - Make shure that the request don't create new sessions. (There are several routes how to achieve that) - Strip the page that you test down to a minmal jsp. (I haven't seen in your previous posts that you say anything about the nature of this page) - Track the memory usage with java.lang.Runtime.get*Memory() - Use the java options to achieve a verbose gc - Set the maximal heap size to a lower bound, to see what happens when this value is reached. - Profile the application with OptimizeIt or jProbe or any other profiler. - show us your page, maybe it's the page that contains the memory leak Sun has some background and advice at: http://java.sun.com/docs/hotspot/gc/ http://java.sun.com/products/hotspot/whitepaper.html Also javaworld: http://www.javaworld.com/javaworld/jw-01-2002/jw-0111-hotspotgc.html Ralph Einfeldt Uptime Internet Solution Center GmbH Hamburg, Germany Hosting, Content Management, Java Consulting http://www.uptime-isc.de -Ursprüngliche Nachricht- Von: Ing. Damiano Bolla [mailto:[EMAIL PROTECTED]] Gesendet: Freitag, 27. September 2002 16:13 An: Tomcat Users List Betreff: RE: Tomcat 4.1.12 memory leak, resources leak, what to do ? Yes, I did let it run and it keeps eating. As far as I see this IS a problem. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: AW: Tomcat 4.1.12 memory leak, resources leak, final call ?
Hi, don't worry about that. It's just that top doesn't show exactly what's going on inside the VM. It WON'T crash your machine. When tomcat hits the limit of the amount of memory allocatted to it, it'll stop increase. It's not a bug. If you want to know how much memory Java is using, Nathan Meyers [EMAIL PROTECTED] suggests this approach: My recommendation is to stop trying to make sense of the output from top and ps, and go to an unambiguous source. Take a look at the contents of /proc/pid/status, where pid is the process ID. This will, at any instant you examine it, give you (among other things) total current VM usage and RSS. Regards miagi - Original Message - From: Ing. Damiano Bolla [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Friday, September 27, 2002 12:19 PM Subject: Re: AW: Tomcat 4.1.12 memory leak, resources leak, final call ? Let me repeat, once more I am reloading the DEFAULT installation page of tomcat. I am NOT using my own page. I am NOT testing a weird servlet. Just the DEFAULT tomcat page. (the one that comes right after you have installed tomcat) Sorry for the capital letters above, I would like to say that 1) I understand the GC concept and heap, BUT there is something wrong if reloading the same page eats all the ram. 2) Thanks to everybody that are tryng to help, BUT please read the mail before posting a reply. 3) Is there one that does NOT have my same problem by doing EXACTLY what I am doing ? If there is one please send me your setup and I will adopt it. Thanks. At 17.04 27/09/2002 +0200, you wrote: - The memory that a vm uses is never decreasing (At least I don't know any that behave that way) To understand that you have to see two different things: - the memory that is used by the vm - the memory inside the vm All vm's that I know, don't return memory to the os. What happens during a gc is just that inside the vm the memory is marked as free. So the only save indicators for the question 'how many memory is currently in use' are the methods java.lang.Runtime.get*Memory. - To a certain degree it is normal that the memory is increasing. Reasons for that: - each session needs some memory, that is only released after the session has timed out. If you create sessions very fast this can consume quite some memory. (If you are creating the sessions faster as they dye tomcat will die with an out of memory error.) - Just because an object isn't used anymore , is dosn't mean that the memory that is consumed by it is freed. This just happens, when the garbage collector runs. When this will happen, is up to the VM. Until then the memory will grow. There is nothing you (or tomcat) can do about that from inside the application. The only action that has affect, is to play with the various parameters for the garbage collector as argument to the java process. So what can you do, to track the problem down: - Make shure that the request don't create new sessions. (There are several routes how to achieve that) - Strip the page that you test down to a minmal jsp. (I haven't seen in your previous posts that you say anything about the nature of this page) - Track the memory usage with java.lang.Runtime.get*Memory() - Use the java options to achieve a verbose gc - Set the maximal heap size to a lower bound, to see what happens when this value is reached. - Profile the application with OptimizeIt or jProbe or any other profiler. - show us your page, maybe it's the page that contains the memory leak Sun has some background and advice at: http://java.sun.com/docs/hotspot/gc/ http://java.sun.com/products/hotspot/whitepaper.html Also javaworld: http://www.javaworld.com/javaworld/jw-01-2002/jw-0111-hotspotgc.html Ralph Einfeldt Uptime Internet Solution Center GmbH Hamburg, Germany Hosting, Content Management, Java Consulting http://www.uptime-isc.de -Ursprüngliche Nachricht- Von: Ing. Damiano Bolla [mailto:[EMAIL PROTECTED]] Gesendet: Freitag, 27. September 2002 16:13 An: Tomcat Users List Betreff: RE: Tomcat 4.1.12 memory leak, resources leak, what to do ? Yes, I did let it run and it keeps eating. As far as I see this IS a problem. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Tomcat 4.1.12 memory leak, resources leak, what to do ?
Hi, In any case, did any of you tried what I did ? Yes. As well as having tried substantially more refined, QC'ed, regulated stress testing of various JDK / Tomcat / OS combinations for memory and other resources leaks. If you have not, then please do not comment.. People are trying to help you out. It's completely voluntary and at their own time / expense. A nicer attitude is likelier to get responses. As far as I see this IS a problem. I disagree. The memory will never decrease without a garbage collection. You have to play with other stuff (limit session creation, limit processing threads, etc) and even then you'd be hard-pressed to keep the memory constant with ongoing page retrievals. P.S. Asking for help at bugzilla had no effect. Yes it did. People looked at it and feel it's not a bug. If you still think it's a bug, submit a patch. That's what open-source is all about. Yoav Shapira Millennium ChemInformatics This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: AW: Tomcat 4.1.12 memory leak, resources leak, final call ?
My recommendation is to stop trying to make sense of the output from top and ps, and go to an unambiguous source. Take a look at the contents of /proc/pid/status, where pid is the process ID. This will, at any instant you examine it, give you (among other things) total current VM usage and RSS. The files under pid doesn't seem to be readable, how should I read it? My OS is Solaris. Thanks. Ricky -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Tomcat 4.1.12 memory leak, resources leak, what to do ?
Have you used the java arg -verbose:gc to track JVM memory usage? top won't tell you whether you have a memory leak because of how the JVM manages its own memory internally. The amount of memory the JVM uses will grow until it reaches the maximum size set for its stack. Then it will do a garbage collection to free up internal memory, but it _never_ returns that memory to the system. Starting Tomcat with the java arg -verbose:gc will output data about the JVM's memory usage and garbage collection. top is useless for evaluating whether there is a memory leak in a java process. No determinations can be made whether there is or is not a memory leak based on its output. If you want to get serious about understanding what is happening within the JVM regarding memory usage then profile your installation with a tool like OptimizeIt or JProbe. Regards, Glenn Shapira, Yoav wrote: Hi, - What I am doing is http://localhost:8080/ and keep refreshing that with F5 - I am NOT testing my own servlet. I am NOT doing anything else !!! I monitor memory usage using top and sorting the results by memory. I am looking at the SIZE column. What I get is an EVER INCREASING memory usage. Something like 30212 30220 31016 31040 31576 Why is that necessarily a leak??? The JVM will allocate as much memory as it wants even for identical resources, up to when a GC is needed. As long as this is all you're doing, it could go up to close to 64MB (the default limit), before everything will be GCed. Did you try going up that high? I wouldn't rush to put in a bug for this ;) Yoav Shapira Millennium ChemInformatics This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Tomcat 4.1.12 memory leak
System: Linux redhat 7.2 Java: /usr/local/j2sdk1.3.1 Tomcat 4.1.12 To reproduce the behaviour you install the 4.1.12 distribution, set the JAVA_HOME run startup.sh and then keep refreshing the homepage http://localhost:8080/ If you monitor the memory usage using top and switching it into display memory usage (Capital M) you sull see tipically something like 22824 22832 22840 23576 23676 23684 23904 23908 23934 23938 . This is the SIZE field of the top command. The point is that it never goes down and eventually you run very slowly. Any idea ? Ah, the same behaviour is with jdk 1.4.1 Damiano -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Tomcat 4.1.12 memory leak
Each request allocates memory. (And relinquishes accordingly) The garbage collector runs when it feels like it should. The JVM will continually suck up memory until it reaches its startup parameters. (-mx ...) Once a JVM takes memory from the OS - it does not release it to the OS - it only releases it to its own memory heap. Ing. Damiano Bolla wrote: System: Linux redhat 7.2 Java: /usr/local/j2sdk1.3.1 Tomcat 4.1.12 To reproduce the behaviour you install the 4.1.12 distribution, set the JAVA_HOME run startup.sh and then keep refreshing the homepage http://localhost:8080/ If you monitor the memory usage using top and switching it into display memory usage (Capital M) you sull see tipically something like 22824 22832 22840 23576 23676 23684 23904 23908 23934 23938 . This is the SIZE field of the top command. The point is that it never goes down and eventually you run very slowly. Any idea ? Ah, the same behaviour is with jdk 1.4.1 Damiano -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Tomcat 4.1.12 memory leak
Good explanation but it does not solve the problem. Let me try to be clear. - What I am doing is reloading always the same page. - What I see is an ever increasing consumption of memory. Really why should the JVM want more and more ram ? In any case if you keep reloading, this ever increasing consumption eventually will eat all your ram. Whatever is the explanation it does not seem right to me, is there a way to fix it ? Damiano At 09.29 26/09/2002 -0400, you wrote: Each request allocates memory. (And relinquishes accordingly) The garbage collector runs when it feels like it should. The JVM will continually suck up memory until it reaches its startup parameters. (-mx ...) Once a JVM takes memory from the OS - it does not release it to the OS - it only releases it to its own memory heap. Ing. Damiano Bolla wrote: System: Linux redhat 7.2 Java: /usr/local/j2sdk1.3.1 Tomcat 4.1.12 To reproduce the behaviour you install the 4.1.12 distribution, set the JAVA_HOME run startup.sh and then keep refreshing the homepage http://localhost:8080/ If you monitor the memory usage using top and switching it into display memory usage (Capital M) you sull see tipically something like 22824 22832 22840 23576 23676 23684 23904 23908 23934 23938 . This is the SIZE field of the top command. The point is that it never goes down and eventually you run very slowly. Any idea ? Ah, the same behaviour is with jdk 1.4.1 Damiano -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Tomcat 4.1.12 memory leak
Each request allocates memory. (And relinquishes accordingly) The garbage collector runs when it feels like it should. The JVM will continually suck up memory until it reaches its startup parameters. (-mx ...) Once a JVM takes memory from the OS - it does not release it to the OS - it only releases it to its own memory heap. How can ww stop the JVM taking memory away from the O/S, any startup parameters I can set ??? -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Tomcat 4.1.12 memory leak
- Strings are allocated to decode the request. - Writers/OutputStreams are created to print to. - Sockets are created - .. other under the covers stuff I'd prefer not to know All of these allocations occur on EVERY request. But they are not immediately garbage collected (gc'd) on every request. The GC only runs when it feels like it. Unless you REALLY know what your doing - tweaking the behavior of the garbage collector is not a good idea. There is no way to fix it because that is how the JVM works. If you need to restrict the size of your JVM - look into the startup parameters. java -X will give you the available parameters. Ing. Damiano Bolla wrote: Good explanation but it does not solve the problem. Let me try to be clear. - What I am doing is reloading always the same page. - What I see is an ever increasing consumption of memory. Really why should the JVM want more and more ram ? In any case if you keep reloading, this ever increasing consumption eventually will eat all your ram. Whatever is the explanation it does not seem right to me, is there a way to fix it ? Damiano At 09.29 26/09/2002 -0400, you wrote: Each request allocates memory. (And relinquishes accordingly) The garbage collector runs when it feels like it should. The JVM will continually suck up memory until it reaches its startup parameters. (-mx ...) Once a JVM takes memory from the OS - it does not release it to the OS - it only releases it to its own memory heap. Ing. Damiano Bolla wrote: System: Linux redhat 7.2 Java: /usr/local/j2sdk1.3.1 Tomcat 4.1.12 To reproduce the behaviour you install the 4.1.12 distribution, set the JAVA_HOME run startup.sh and then keep refreshing the homepage http://localhost:8080/ If you monitor the memory usage using top and switching it into display memory usage (Capital M) you sull see tipically something like 22824 22832 22840 23576 23676 23684 23904 23908 23934 23938 . This is the SIZE field of the top command. The point is that it never goes down and eventually you run very slowly. Any idea ? Ah, the same behaviour is with jdk 1.4.1 Damiano -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Tomcat 4.1.12 memory leak
you can easily test it out by setting JAVA_OPTS='-Xmx=64M' I've ran extensive load testing with 4.1.10 w/o any problems. Haven't done it with 4.1.12, but hopefully it's not a new bug, since the release notes don't list anything that might create a new bug. peter Ing. Damiano Bolla wrote: Good explanation but it does not solve the problem. Let me try to be clear. - What I am doing is reloading always the same page. - What I see is an ever increasing consumption of memory. Really why should the JVM want more and more ram ? In any case if you keep reloading, this ever increasing consumption eventually will eat all your ram. Whatever is the explanation it does not seem right to me, is there a way to fix it ? Damiano -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Tomcat 4.1.12 memory leak
I am experiencing the same problem with tomcat 4.0.3. I have my JVM memory setting as -Xms=32 -Xmx=384 and running the tomcat on Sun Solaris 2.7, integrated with Apache 1.3.x through warp connector. I have a JSP page monitoring the memory consumption at http://www.emerging-trade.pt/servlets/memory.jsp, The memory consumption pattern of the JSP shows the GC runs as you can see the increase/decerece in the free memory of the current heap size. Raj Saini Raj Saini - Original Message - From: Tim Funk [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Thursday, September 26, 2002 2:29 PM Subject: Re: Tomcat 4.1.12 memory leak Each request allocates memory. (And relinquishes accordingly) The garbage collector runs when it feels like it should. The JVM will continually suck up memory until it reaches its startup parameters. (-mx ...) Once a JVM takes memory from the OS - it does not release it to the OS - it only releases it to its own memory heap. Ing. Damiano Bolla wrote: System: Linux redhat 7.2 Java: /usr/local/j2sdk1.3.1 Tomcat 4.1.12 To reproduce the behaviour you install the 4.1.12 distribution, set the JAVA_HOME run startup.sh and then keep refreshing the homepage http://localhost:8080/ If you monitor the memory usage using top and switching it into display memory usage (Capital M) you sull see tipically something like 22824 22832 22840 23576 23676 23684 23904 23908 23934 23938 . This is the SIZE field of the top command. The point is that it never goes down and eventually you run very slowly. Any idea ? Ah, the same behaviour is with jdk 1.4.1 Damiano -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Tomcat 4.1.12 memory leak
are you seeing the same behavior in 4.1.10? or is it just 4.1.12? I've performed some moderate load testing with 4.1.10 and in two cases where memory consumption went up, it was my own code that caused it. Once I profiled my webapp and looked at gc, it was obvious the culprit was my code. you can run tomcat with the following options to see in greater detail what is happening. JAVA_OPTS='-verbosegc' JAVA_OPTS='-Xloggc:/temp/log.log' peter lin Raj Saini wrote: I am experiencing the same problem with tomcat 4.0.3. I have my JVM memory setting as -Xms=32 -Xmx=384 and running the tomcat on Sun Solaris 2.7, integrated with Apache 1.3.x through warp connector. I have a JSP page monitoring the memory consumption at http://www.emerging-trade.pt/servlets/memory.jsp, The memory consumption pattern of the JSP shows the GC runs as you can see the increase/decerece in the free memory of the current heap size. Raj Saini Raj Saini - Original Message - From: Tim Funk [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Thursday, September 26, 2002 2:29 PM Subject: Re: Tomcat 4.1.12 memory leak Each request allocates memory. (And relinquishes accordingly) The garbage collector runs when it feels like it should. The JVM will continually suck up memory until it reaches its startup parameters. (-mx ...) Once a JVM takes memory from the OS - it does not release it to the OS - it only releases it to its own memory heap. Ing. Damiano Bolla wrote: System: Linux redhat 7.2 Java: /usr/local/j2sdk1.3.1 Tomcat 4.1.12 To reproduce the behaviour you install the 4.1.12 distribution, set the JAVA_HOME run startup.sh and then keep refreshing the homepage http://localhost:8080/ If you monitor the memory usage using top and switching it into display memory usage (Capital M) you sull see tipically something like 22824 22832 22840 23576 23676 23684 23904 23908 23934 23938 . This is the SIZE field of the top command. The point is that it never goes down and eventually you run very slowly. Any idea ? Ah, the same behaviour is with jdk 1.4.1 Damiano -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Tomcat 4.1.12 memory leak, still
I did two more test, here are the results. At 09.50 26/09/2002 -0400, you wrote: you can easily test it out by setting JAVA_OPTS='-Xmx=64M' Did set the above before starting tomcat and had the folowing results. This is the value of SIZE of top 22684 22692 22700 23560 23908 23960 23980 24040 24170 24328 24432 24468 24492 24552 24572 24704 24760 24768 24788 Always reloading the same page (the default page) I then changed JAVA_OPTS='-Xmx=24M' and I still had an increasing result 22848 23576 23592 23804 23836 23896 23972 23992 24080 24152 And I must say that if I keep reloading it will keep increasing. It is a very simple test to do, are you shure that you have the SIZE number decreasing sometimes ? It chews little ram at the time so if you have 1Gb ram you notice it only if you really look at it. I've ran extensive load testing with 4.1.10 w/o any problems. Haven't done it with 4.1.12, but hopefully it's not a new bug, since the release notes don't list anything that might create a new bug. peter Ing. Damiano Bolla wrote: Good explanation but it does not solve the problem. Let me try to be clear. - What I am doing is reloading always the same page. - What I see is an ever increasing consumption of memory. Really why should the JVM want more and more ram ? In any case if you keep reloading, this ever increasing consumption eventually will eat all your ram. Whatever is the explanation it does not seem right to me, is there a way to fix it ? Damiano -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Tomcat 4.1.12 memory leak
Hi, some time ago i had extreme problems with RedHat 7.2. Even if no big applications are running, the whole available memory size seems to decrease all the time. Have you tried to verify the problem with the same Tomcat version and a different environment like Solaris or W2K or a different Linux distribution like Debian or SuSE? Cheers Holger - Original Message - From: Ing. Damiano Bolla [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, September 26, 2002 3:17 PM Subject: Tomcat 4.1.12 memory leak System: Linux redhat 7.2 Java: /usr/local/j2sdk1.3.1 Tomcat 4.1.12 To reproduce the behaviour you install the 4.1.12 distribution, set the JAVA_HOME run startup.sh and then keep refreshing the homepage http://localhost:8080/ If you monitor the memory usage using top and switching it into display memory usage (Capital M) you sull see tipically something like 22824 22832 22840 23576 23676 23684 23904 23908 23934 23938 . This is the SIZE field of the top command. The point is that it never goes down and eventually you run very slowly. Any idea ? Ah, the same behaviour is with jdk 1.4.1 Damiano -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Tomcat 4.1.12 memory leak, still
JAVA_OPTS='-Xmx=64M' I remember I saw in Sun's website that it's lowercase for all, k for kilo, m for mega, and g for giga, but in this group, people always say use capital letters. Now I am confused! -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Tomcat 4.1.12 memory leak, still
I use lowercase letters with fine results.. -Original Message- From: Ricky Leung [mailto:[EMAIL PROTECTED]] Sent: 26. september 2002 14:23 To: Tomcat Users List Subject: RE: Tomcat 4.1.12 memory leak, still JAVA_OPTS='-Xmx=64M' I remember I saw in Sun's website that it's lowercase for all, k for kilo, m for mega, and g for giga, but in this group, people always say use capital letters. Now I am confused! -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Tomcat 4.1.12 memory leak, still
I also did a small test where I was calling a simple servlet in a loop. The only resource used in the servlet was a random number generator. The tomcat crashed after running few hours. I used the tomcat 4.1.10 for this. Though I did this test on a very small machine (Intel 166Mhz with 128 MB RAM), but the real reason of the crash was the insufficent memory. Tomcat had used all the physical and the swap file size grown upto 300 MB. Since there was no enough space on the file system and swap file size could not be increased, Tomcat crashed eventually. I attach the servlet code for you evaluation. Raj Saini - Original Message - From: Ing. Damiano Bolla [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Thursday, September 26, 2002 3:14 PM Subject: Re: Tomcat 4.1.12 memory leak, still I did two more test, here are the results. At 09.50 26/09/2002 -0400, you wrote: you can easily test it out by setting JAVA_OPTS='-Xmx=64M' Did set the above before starting tomcat and had the folowing results. This is the value of SIZE of top 22684 22692 22700 23560 23908 23960 23980 24040 24170 24328 24432 24468 24492 24552 24572 24704 24760 24768 24788 Always reloading the same page (the default page) I then changed JAVA_OPTS='-Xmx=24M' and I still had an increasing result 22848 23576 23592 23804 23836 23896 23972 23992 24080 24152 And I must say that if I keep reloading it will keep increasing. It is a very simple test to do, are you shure that you have the SIZE number decreasing sometimes ? It chews little ram at the time so if you have 1Gb ram you notice it only if you really look at it. I've ran extensive load testing with 4.1.10 w/o any problems. Haven't done it with 4.1.12, but hopefully it's not a new bug, since the release notes don't list anything that might create a new bug. peter Ing. Damiano Bolla wrote: Good explanation but it does not solve the problem. Let me try to be clear. - What I am doing is reloading always the same page. - What I see is an ever increasing consumption of memory. Really why should the JVM want more and more ram ? In any case if you keep reloading, this ever increasing consumption eventually will eat all your ram. Whatever is the explanation it does not seem right to me, is there a way to fix it ? Damiano -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] HttpProxyServlet.java Description: Binary data -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Tomcat 4.1.12 memory leak, still
you may want to first try running tomcat with verbose gc turned on. this will tell you whether or not it is working correctly. refer to previous email I sent with the java options for verbose gc. peter lin Raj Saini wrote: I also did a small test where I was calling a simple servlet in a loop. The only resource used in the servlet was a random number generator. The tomcat crashed after running few hours. I used the tomcat 4.1.10 for this. Though I did this test on a very small machine (Intel 166Mhz with 128 MB RAM), but the real reason of the crash was the insufficent memory. Tomcat had used all the physical and the swap file size grown upto 300 MB. Since there was no enough space on the file system and swap file size could not be increased, Tomcat crashed eventually. I attach the servlet code for you evaluation. Raj Saini -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Tomcat 4.1.12 memory leak
I also experienced this problem using the inline module on a Win2K Advanced server with Apache 2.0.40/Tomcat 4.1.10. Rather than trust the combination I ended up going down to Apache 1.3.26/Tomcat 3.3.1 on a Novell box. For me, setting the -mx paramters did nothing to change the situation. The server still gobbed up memory and resources until it imploded and I had to reboot. Something as simple as holding down the refresh key for 3 minutes was enough to crash it. Not good for a production environment. Craig [EMAIL PROTECTED] 09/26/02 08:41AM Good explanation but it does not solve the problem. Let me try to be clear. - What I am doing is reloading always the same page. - What I see is an ever increasing consumption of memory. Really why should the JVM want more and more ram ? In any case if you keep reloading, this ever increasing consumption eventually will eat all your ram. Whatever is the explanation it does not seem right to me, is there a way to fix it ? Damiano At 09.29 26/09/2002 -0400, you wrote: Each request allocates memory. (And relinquishes accordingly) The garbage collector runs when it feels like it should. The JVM will continually suck up memory until it reaches its startup parameters. (-mx ...) Once a JVM takes memory from the OS - it does not release it to the OS - it only releases it to its own memory heap. Ing. Damiano Bolla wrote: System: Linux redhat 7.2 Java: /usr/local/j2sdk1.3.1 Tomcat 4.1.12 To reproduce the behaviour you install the 4.1.12 distribution, set the JAVA_HOME run startup.sh and then keep refreshing the homepage http://localhost:8080/ If you monitor the memory usage using top and switching it into display memory usage (Capital M) you sull see tipically something like 22824 22832 22840 23576 23676 23684 23904 23908 23934 23938 . This is the SIZE field of the top command. The point is that it never goes down and eventually you run very slowly. Any idea ? Ah, the same behaviour is with jdk 1.4.1 Damiano -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Tomcat 4.1.12 memory leak
That's funny, I'm using the exact configuration you were using, Win2K Advanced server with Apache 2.0.40/Tomcat 4.1.10 only with a heavy duty ArcIMS app and I've not seen this. On the contrary, it's been just the opposite for us. The same app under Apache 1.3.26/Tomcat 3.3.1, was eating all the memory. The only real difference was moving from Java 1.3.1 to 1.4.0. rls craig franke [EMAIL PROTECTED] 09/26/2002 07:54 AM Please respond to Tomcat Users List To: [EMAIL PROTECTED] cc: Subject:Re: Tomcat 4.1.12 memory leak I also experienced this problem using the inline module on a Win2K Advanced server with Apache 2.0.40/Tomcat 4.1.10. Rather than trust the combination I ended up going down to Apache 1.3.26/Tomcat 3.3.1 on a Novell box. For me, setting the -mx paramters did nothing to change the situation. The server still gobbed up memory and resources until it imploded and I had to reboot. Something as simple as holding down the refresh key for 3 minutes was enough to crash it. Not good for a production environment. Craig [EMAIL PROTECTED] 09/26/02 08:41AM Good explanation but it does not solve the problem. Let me try to be clear. - What I am doing is reloading always the same page. - What I see is an ever increasing consumption of memory. Really why should the JVM want more and more ram ? In any case if you keep reloading, this ever increasing consumption eventually will eat all your ram. Whatever is the explanation it does not seem right to me, is there a way to fix it ? Damiano At 09.29 26/09/2002 -0400, you wrote: Each request allocates memory. (And relinquishes accordingly) The garbage collector runs when it feels like it should. The JVM will continually suck up memory until it reaches its startup parameters. (-mx ...) Once a JVM takes memory from the OS - it does not release it to the OS - it only releases it to its own memory heap. Ing. Damiano Bolla wrote: System: Linux redhat 7.2 Java: /usr/local/j2sdk1.3.1 Tomcat 4.1.12 To reproduce the behaviour you install the 4.1.12 distribution, set the JAVA_HOME run startup.sh and then keep refreshing the homepage http://localhost:8080/ If you monitor the memory usage using top and switching it into display memory usage (Capital M) you sull see tipically something like 22824 22832 22840 23576 23676 23684 23904 23908 23934 23938 . This is the SIZE field of the top command. The point is that it never goes down and eventually you run very slowly. Any idea ? Ah, the same behaviour is with jdk 1.4.1 Damiano -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Tomcat 4.1.12 memory leak
The easiest way to track JVM garbage collection is to start java with the -verbose:gc arg. This enables GC data output to stdout. Regards, Glenn Raj Saini wrote: I am experiencing the same problem with tomcat 4.0.3. I have my JVM memory setting as -Xms=32 -Xmx=384 and running the tomcat on Sun Solaris 2.7, integrated with Apache 1.3.x through warp connector. I have a JSP page monitoring the memory consumption at http://www.emerging-trade.pt/servlets/memory.jsp, The memory consumption pattern of the JSP shows the GC runs as you can see the increase/decerece in the free memory of the current heap size. Raj Saini Raj Saini - Original Message - From: Tim Funk [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Thursday, September 26, 2002 2:29 PM Subject: Re: Tomcat 4.1.12 memory leak Each request allocates memory. (And relinquishes accordingly) The garbage collector runs when it feels like it should. The JVM will continually suck up memory until it reaches its startup parameters. (-mx ...) Once a JVM takes memory from the OS - it does not release it to the OS - it only releases it to its own memory heap. Ing. Damiano Bolla wrote: System: Linux redhat 7.2 Java: /usr/local/j2sdk1.3.1 Tomcat 4.1.12 To reproduce the behaviour you install the 4.1.12 distribution, set the JAVA_HOME run startup.sh and then keep refreshing the homepage http://localhost:8080/ If you monitor the memory usage using top and switching it into display memory usage (Capital M) you sull see tipically something like 22824 22832 22840 23576 23676 23684 23904 23908 23934 23938 . This is the SIZE field of the top command. The point is that it never goes down and eventually you run very slowly. Any idea ? Ah, the same behaviour is with jdk 1.4.1 Damiano -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]