Re: Memory Settings On Tomcat
Endre Stølsvik wrote: Why not? I don't think this is correct. See, if the class isn't referenced anymore, by not having any referenced objects of that class (by any reference), nor having the class object referenced, on the stack of any of the JVM's created Threads, then the static fields of that class isn't referenced either, and thus both will be gc'ed, and then the classloader will be gc'ed.. More on this here: http://java.sun.com/docs/books/jls/second_edition/html/execution.doc.html#74294 IMHO there is no problem in classloaders being thrown away. BTW NetBeans module system successfully unloads (discards) disabled modules. Don't know why tomcat should not do the same ... (But you might have to deal with http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4646668 and maybe other subtle problems). David - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Memory Settings On Tomcat
On Wed, 16 Jun 2004, Shapira, Yoav wrote: | | Hola ;) | | Okay? Expected? I don't get that. Can you point me to a email-subject | of | one of those threads? Or several?! | | There are a number of issues in this space. For example, if your | servlet class keep a static reference, that can't be garbage collected | when the webapp is recycled. | Therefore the old class definition itself can't be discarded and must be | kept along with its classloader in the JVM. A new classloader is | created and loads new copies of your webapp classes, resulting in a | total memory increase. | Why not? I don't think this is correct. See, if the class isn't referenced anymore, by not having any referenced objects of that class (by any reference), nor having the class object referenced, on the stack of any of the JVM's created Threads, then the static fields of that class isn't referenced either, and thus both will be gc'ed, and then the classloader will be gc'ed.. | Eventually, we made a note of this in the release notes: see the section | titled Web application reloading and static fields in shared | libraries. This concerns something else, but is a very good point. I didn't actually know that any -shared- standard Java library will put references to my objects in its internal structures. Know of any specific examples of this? | | That's one example. There are other more insidious cases. If you | search the list archives (or even google) for things like tomcat webapp | reload memory leak or tomcat reload OutOfMemoryError you'll see the | threads and discussions, e.g. | http://www.junlu.com/msg/38828.html and | http://www.junlu.com/msg/13981.html. I will do this - and thanks a LOT for your time and information so far! Endre. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Memory Settings On Tomcat
On Tue, 15 Jun 2004, Shapira, Yoav wrote: | | Hola, Yo! | | I know - but Sun's VMs surely seems to follow your suggestions! | | They might, and they might not, that's the point. Other VM | implementations can choose to ignore System.gc(), or even Sun | implementations on certain platforms (many J2ME installations ignore | these calls). Yes - and I suggested that one could try it out, just for kicks..! ;) | | That depends on your platform and settings. Most definately - but Sun's VMs have been doing this for some time (always?), and thus the gc() diff is interesting on this particular VM, at least. | | I have to debug this now, it will be interesting to see if it is Tomcat | code or my code that have the bug..! ;) | | It is expected that every reload will increase total memory usage, | monotonically, it's not a bug, and there are numerous discussions about | this and related issues in the arhicves. Okay? Expected? I don't get that. Can you point me to a email-subject of one of those threads? Or several?! Thanks for info, anyway! Endre. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Memory Settings On Tomcat
Hola ;) Okay? Expected? I don't get that. Can you point me to a email-subject of one of those threads? Or several?! There are a number of issues in this space. For example, if your servlet class keep a static reference, that can't be garbage collected when the webapp is recycled. Therefore the old class definition itself can't be discarded and must be kept along with its classloader in the JVM. A new classloader is created and loads new copies of your webapp classes, resulting in a total memory increase. Eventually, we made a note of this in the release notes: see the section titled Web application reloading and static fields in shared libraries. That's one example. There are other more insidious cases. If you search the list archives (or even google) for things like tomcat webapp reload memory leak or tomcat reload OutOfMemoryError you'll see the threads and discussions, e.g. http://www.junlu.com/msg/38828.html and http://www.junlu.com/msg/13981.html. Yoav Shapira 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Memory Settings On Tomcat
this might be a bit off topic, but if you want to profile your app in tomcat, Sun Research has an experimental VM called JFluid. http://research.sun.com/projects/jfluid/ it is basically the jdk1.4.2_03 vm with hooks for profiling. it might help track down GC and memory issues for those who don't have a license of OptimizeIt. peter Endre_Stølsvik [EMAIL PROTECTED] wrote:On Tue, 15 Jun 2004, Shapira, Yoav wrote: | | Hola, Yo! | | I know - but Sun's VMs surely seems to follow your suggestions! | | They might, and they might not, that's the point. Other VM | implementations can choose to ignore System.gc(), or even Sun | implementations on certain platforms (many J2ME installations ignore | these calls). Yes - and I suggested that one could try it out, just for kicks..! ;) | | That depends on your platform and settings. Most definately - but Sun's VMs have been doing this for some time (always?), and thus the gc() diff is interesting on this particular VM, at least. | | I have to debug this now, it will be interesting to see if it is Tomcat | code or my code that have the bug..! ;) | | It is expected that every reload will increase total memory usage, | monotonically, it's not a bug, and there are numerous discussions about | this and related issues in the arhicves. Okay? Expected? I don't get that. Can you point me to a email-subject of one of those threads? Or several?! Thanks for info, anyway! Endre. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Do you Yahoo!? Yahoo! Mail - You care about security. So do we.
RE: Memory Settings On Tomcat
On Mon, 14 Jun 2004, Woodchuck wrote: | Runtime.getRuntime().maxMemory() will get you the | maximum amount of memory for your jvm. Yeah, check out maxMem, freeMem and totalMem.. Are those something along the line of what you're looking for? Endre - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Memory Settings On Tomcat
On Tue, 15 Jun 2004, Endre Stølsvik wrote: | On Mon, 14 Jun 2004, Woodchuck wrote: | | | Runtime.getRuntime().maxMemory() will get you the | | maximum amount of memory for your jvm. | | Yeah, check out maxMem, freeMem and totalMem.. Are those something along | the line of what you're looking for? You might also want to try .gc() (force Garbage Collection) - run freeMemory() right before and right after .gc(), print out the diff too. Interesting numbers, these - I can stay up all night watching them unfold over my screen.. growing, shrinking.. growing .. growing .. GROWING?? ah.. shrinking.. shrinking.. You get the point.. Endre. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Memory Settings On Tomcat
Hi, You might also want to try .gc() (force Garbage Collection) - run freeMemory() right before and right after .gc(), print out the diff too. Man, I expect this error from novice posters, but not from you ;) System.gc is ONLY A SUGGESTION. The more recent the JVM, the more likely it is to be ignored by the JVM, and moreover more and more admins/developers I know are setting -XX:+DisableExplicitGC as a Standard Operating Procedure. Don't count on System.gc for anything. Yoav 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Memory Settings On Tomcat
On Tue, 15 Jun 2004, Shapira, Yoav wrote: | | Hi, | | You might also want to try .gc() (force Garbage Collection) - run | freeMemory() right before and right after .gc(), print out the diff | too. | | Man, I expect this error from novice posters, but not from you ;) Oh, thanks..! ;) | System.gc is ONLY A SUGGESTION. I know - but Sun's VMs surely seems to follow your suggestions! | The more recent the JVM, the more likely it is to be ignored by the | JVM, and moreover more and more admins/developers I know are setting | -XX:+DisableExplicitGC as a Standard Operating Procedure. Don't count | on System.gc for anything. Well, 1.5beta2 (that's rather recent, ai?) GC's like hell when I invoke the method - it even seems to do it synchronous, as it (currentThread) hangs while it does it.. I only said this as an suggestion for seeing if you have tons of dead objects lying around - you might be able to figure something out based on the diff. On my system, I get a considerable diff after some time, but I feel this is expected. A worse thing is that after each restart of my app I get less memory free, and eventually I run out (it isn't much each time, but after e.g. 40 reloads, there aren't many megs left of my initial 64). I have to debug this now, it will be interesting to see if it is Tomcat code or my code that have the bug..! ;) Btw: you can turn on verbose gc on the JVM, this is cool: -verbose:gc Report on each garbage collection event. And then, Yoav, you can se that your objects are killed -when you invoke gc()-! ;) Endre. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Memory Settings On Tomcat
Hola, I know - but Sun's VMs surely seems to follow your suggestions! They might, and they might not, that's the point. Other VM implementations can choose to ignore System.gc(), or even Sun implementations on certain platforms (many J2ME installations ignore these calls). Well, 1.5beta2 (that's rather recent, ai?) GC's like hell when I invoke the method - it even seems to do it synchronous, as it (currentThread) hangs while it does it.. That depends on your platform and settings. I have to debug this now, it will be interesting to see if it is Tomcat code or my code that have the bug..! ;) It is expected that every reload will increase total memory usage, monotonically, it's not a bug, and there are numerous discussions about this and related issues in the arhicves. Btw: you can turn on verbose gc on the JVM, this is cool: -verbose:gc Report on each garbage collection event. And then, Yoav, you can se that your objects are killed -when you invoke gc()-! ;) Again, only under some (certainly the most common) settings. Yoav Shapira 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Memory Settings On Tomcat
Hi, I downloaded this and it seems to have potential. Unfortunately I cant work out where to get the heap sizing information which is one of the more important things to us. Anyway used it and can point me in the right direction. Ta Matt -Original Message- From: Peter Lin [mailto:[EMAIL PROTECTED] Sent: 10 June 2004 03:15 To: Tomcat Users List Subject: RE: Memory Settings On Tomcat by the way, in case you haven't heard of it, http://mc4j.sourceforge.net/ mc4J can monitor tomcat4 and generate nice graphs. I haven't used it, but it looks nice. peter --- Michael Duffy [EMAIL PROTECTED] wrote: Hi Peter, Hiding in plain sight: http://jakarta.apache.org/tomcat/articles/performance.pdf I apologize for overlooking it for all this time. I'll be sure to go through it right away. Thanks - % --- Peter Lin [EMAIL PROTECTED] wrote: You might want to look at the VM performance numbers in my Performance article. The link is listed on the tomcat resources page. Generally, tweaking the generations takes time. for something, like XML, tweaking generation ratio doesn't help. peter Michael Duffy [EMAIL PROTECTED] wrote: Hi Yoav, Yes to 1, and likely yes to 2. Check out the different garbage collector implementations, and the directives for setting old and young generation sizes. Your case is a classic one for setting a small old generation size relative to the young generation size: maybe even a 10-1 or slightly less ratio of young size to old size. I've never checked this page out before, but at your prompting I found it today: http://java.sun.com/docs/hotspot/VMOptions.html I believe the docs are telling me that the default value of XX:NewRatio=12 for Intel. Is that correct? If that's true, should I just leave the default? I have no experience with setting any of these values. I've always used the JVM right out of the box (my ignorance). What would be a minimum set of parameters to span this space? Thanks - % --- Shapira, Yoav wrote: Hi, I've got Tomcat 4.1.29 installed to run as a service under JDK 1.4.1_05 on this Windows 2000 server. The Tomcat memory settings on startup are -Xms64m and -Xmx1024m. The server has 512MB of physical RAM It's not a good idea to set -Xmx to a higher amount than the amount of physical RAM: the JVM will thrash once it reaches much less than 512MB. My understanding is that Java's garbage collection will reclaim heap-allocated memory to the JVM, but not necessarily to the OS. Is this true? What this means is that a Windoze server admin could look at the task manager and see a large memory usage for Tomcat, but that doesn't necessarily reflect Tomcat's current usage. It's more like a high water mark on a pier: it'll show the highest value that Tomcat has used, but the real value will be lower if the garbage collector runs and the tide goes out. If you read a lot of objects into session you could end up with a big high water mark. Your understanding is good and correct on the above issues. (1) Is my understanding of the interaction between the JVM and OS memory management correct? (2) Are there any other tuning settings for Tomcat that I need to look at? Yes to 1, and likely yes to 2. Check out the different garbage collector implementations, and the directives for setting old and young generation sizes. Your case is a classic one for setting a small old generation size relative to the young generation size: maybe even a 10-1 or slightly less ratio of young size to old size. And there's the ever-present (which is why it's often forgotten) advice: you might want to get more physical RAM. It's pretty cheap, and 512MB isn't that much for a server nowadays. Yoav 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL
RE: Memory Settings On Tomcat
I wish I could help you here, but I haven't used it. I know some people on the mailing list have. Hopefully one of them will respond. You probably should post a message to MC4J mailing list for asssitance. peter Dale, Matt [EMAIL PROTECTED] wrote:Hi, I downloaded this and it seems to have potential. Unfortunately I cant work out where to get the heap sizing information which is one of the more important things to us. Anyway used it and can point me in the right direction. Ta Matt - Do you Yahoo!? Friends. Fun. Try the all-new Yahoo! Messenger
RE: Memory Settings On Tomcat
Runtime.getRuntime().maxMemory() will get you the maximum amount of memory for your jvm. --- Dale, Matt [EMAIL PROTECTED] wrote: Hi, I downloaded this and it seems to have potential. Unfortunately I cant work out where to get the heap sizing information which is one of the more important things to us. Anyway used it and can point me in the right direction. Ta Matt __ Do you Yahoo!? Friends. Fun. Try the all-new Yahoo! Messenger. http://messenger.yahoo.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Memory Settings On Tomcat
Thank you, Peter, I'll give it a look. % --- Peter Lin [EMAIL PROTECTED] wrote: by the way, in case you haven't heard of it, http://mc4j.sourceforge.net/ mc4J can monitor tomcat4 and generate nice graphs. I haven't used it, but it looks nice. peter --- Michael Duffy [EMAIL PROTECTED] wrote: Hi Peter, Hiding in plain sight: http://jakarta.apache.org/tomcat/articles/performance.pdf I apologize for overlooking it for all this time. I'll be sure to go through it right away. Thanks - % --- Peter Lin [EMAIL PROTECTED] wrote: You might want to look at the VM performance numbers in my Performance article. The link is listed on the tomcat resources page. Generally, tweaking the generations takes time. for something, like XML, tweaking generation ratio doesn't help. peter Michael Duffy [EMAIL PROTECTED] wrote: Hi Yoav, Yes to 1, and likely yes to 2. Check out the different garbage collector implementations, and the directives for setting old and young generation sizes. Your case is a classic one for setting a small old generation size relative to the young generation size: maybe even a 10-1 or slightly less ratio of young size to old size. I've never checked this page out before, but at your prompting I found it today: http://java.sun.com/docs/hotspot/VMOptions.html I believe the docs are telling me that the default value of XX:NewRatio=12 for Intel. Is that correct? If that's true, should I just leave the default? I have no experience with setting any of these values. I've always used the JVM right out of the box (my ignorance). What would be a minimum set of parameters to span this space? Thanks - % --- Shapira, Yoav wrote: Hi, I've got Tomcat 4.1.29 installed to run as a service under JDK 1.4.1_05 on this Windows 2000 server. The Tomcat memory settings on startup are -Xms64m and -Xmx1024m. The server has 512MB of physical RAM It's not a good idea to set -Xmx to a higher amount than the amount of physical RAM: the JVM will thrash once it reaches much less than 512MB. My understanding is that Java's garbage collection will reclaim heap-allocated memory to the JVM, but not necessarily to the OS. Is this true? What this means is that a Windoze server admin could look at the task manager and see a large memory usage for Tomcat, but that doesn't necessarily reflect Tomcat's current usage. It's more like a high water mark on a pier: it'll show the highest value that Tomcat has used, but the real value will be lower if the garbage collector runs and the tide goes out. If you read a lot of objects into session you could end up with a big high water mark. Your understanding is good and correct on the above issues. (1) Is my understanding of the interaction between the JVM and OS memory management correct? (2) Are there any other tuning settings for Tomcat that I need to look at? Yes to 1, and likely yes to 2. Check out the different garbage collector implementations, and the directives for setting old and young generation sizes. Your case is a classic one for setting a small old generation size relative to the young generation size: maybe even a 10-1 or slightly less ratio of young size to old size. And there's the ever-present (which is why it's often forgotten) advice: you might want to get more physical RAM. It's pretty cheap, and 512MB isn't that much for a server nowadays. Yoav 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Memory Settings On Tomcat
Hi, I've got Tomcat 4.1.29 installed to run as a service under JDK 1.4.1_05 on this Windows 2000 server. The Tomcat memory settings on startup are -Xms64m and -Xmx1024m. The server has 512MB of physical RAM It's not a good idea to set -Xmx to a higher amount than the amount of physical RAM: the JVM will thrash once it reaches much less than 512MB. My understanding is that Java's garbage collection will reclaim heap-allocated memory to the JVM, but not necessarily to the OS. Is this true? What this means is that a Windoze server admin could look at the task manager and see a large memory usage for Tomcat, but that doesn't necessarily reflect Tomcat's current usage. It's more like a high water mark on a pier: it'll show the highest value that Tomcat has used, but the real value will be lower if the garbage collector runs and the tide goes out. If you read a lot of objects into session you could end up with a big high water mark. Your understanding is good and correct on the above issues. (1) Is my understanding of the interaction between the JVM and OS memory management correct? (2) Are there any other tuning settings for Tomcat that I need to look at? Yes to 1, and likely yes to 2. Check out the different garbage collector implementations, and the directives for setting old and young generation sizes. Your case is a classic one for setting a small old generation size relative to the young generation size: maybe even a 10-1 or slightly less ratio of young size to old size. And there's the ever-present (which is why it's often forgotten) advice: you might want to get more physical RAM. It's pretty cheap, and 512MB isn't that much for a server nowadays. Yoav 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Memory Settings On Tomcat
if you can upgrade to tomcat5, I would recommend it. the reason I suggest this is TC5 has the new status servlet, which will tell you how much heap is actually in use currently. the JVM will not release memory back to the OS that is true. in terms of performance the biggest indicator of poor performance is the rate at which the heap grows and the frequency of full GC. Applications that are well behaved should result in regular intervals of full GC. Poor performing applications wiill cause erratic and frequent full GC. Even if you can't upgrade to TC5, it might be worth it to d/l and install it. Once you have it installed, you can use JMeter to view the server load and the memory usage pattern. I hope that helps. peter Michael Duffy [EMAIL PROTECTED] wrote:I recently had a problem with a Windoze server hanging up due to memory problems. I've got Tomcat 4.1.29 installed to run as a service under JDK 1.4.1_05 on this Windows 2000 server. The Tomcat memory settings on startup are -Xms64m and -Xmx1024m. The server has 512MB of physical RAM installed. The Windoze task manager says Tomcat is sitting at ~128MB of memory. My understanding is that Java's garbage collection will reclaim heap-allocated memory to the JVM, but not necessarily to the OS. Is this true? What this means is that a Windoze server admin could look at the task manager and see a large memory usage for Tomcat, but that doesn't necessarily reflect Tomcat's current usage. It's more like a high water mark on a pier: it'll show the highest value that Tomcat has used, but the real value will be lower if the garbage collector runs and the tide goes out. If you read a lot of objects into session you could end up with a big high water mark. The application is a JSP front end with a single controller servlet that interacts with an Oracle database. The only data members in the servlet are some read-only map that are initialized on startup. There are some session data that are maintained for certain user requests, but the rest are all stateless request/response. The server admin is saying that the problem is Windoze memory management. When a new process starts up outside of Tomcat, it could be that memory isn't reachable, and the new process hangs. We're going to increase the virtual page size on Windoze and change the startup settings for the Tomcat service to -Xms256m and -Xmx1536m. So my questions are: (1) Is my understanding of the interaction between the JVM and OS memory management correct? (2) Are there any other tuning settings for Tomcat that I need to look at? Thanks - % __ Do you Yahoo!? Friends. Fun. Try the all-new Yahoo! Messenger. http://messenger.yahoo.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Do you Yahoo!? Friends. Fun. Try the all-new Yahoo! Messenger
RE: Memory Settings On Tomcat
Hi Yoav, Just the person I was hoping to hear from! Thanks for responding. It's not a good idea to set -Xmx to a higher amount than the amount of physical RAM: the JVM will thrash once it reaches much less than 512MB. Oh, my, so -Xmx512m is the best I can do. Your understanding is good and correct on the above issues. Thank you for confirming that. And there's the ever-present (which is why it's often forgotten) advice: you might want to get more physical RAM. It's pretty cheap, and 512MB isn't that much for a server nowadays. Quite correct, but I don't make that decision. That's left to our enlightened corporate IT staff. ;) I'll look into those other JVM settings. Thanks again for your usual sage advice. Sincerely, % --- Shapira, Yoav [EMAIL PROTECTED] wrote: Hi, I've got Tomcat 4.1.29 installed to run as a service under JDK 1.4.1_05 on this Windows 2000 server. The Tomcat memory settings on startup are -Xms64m and -Xmx1024m. The server has 512MB of physical RAM It's not a good idea to set -Xmx to a higher amount than the amount of physical RAM: the JVM will thrash once it reaches much less than 512MB. My understanding is that Java's garbage collection will reclaim heap-allocated memory to the JVM, but not necessarily to the OS. Is this true? What this means is that a Windoze server admin could look at the task manager and see a large memory usage for Tomcat, but that doesn't necessarily reflect Tomcat's current usage. It's more like a high water mark on a pier: it'll show the highest value that Tomcat has used, but the real value will be lower if the garbage collector runs and the tide goes out. If you read a lot of objects into session you could end up with a big high water mark. Your understanding is good and correct on the above issues. (1) Is my understanding of the interaction between the JVM and OS memory management correct? (2) Are there any other tuning settings for Tomcat that I need to look at? Yes to 1, and likely yes to 2. Check out the different garbage collector implementations, and the directives for setting old and young generation sizes. Your case is a classic one for setting a small old generation size relative to the young generation size: maybe even a 10-1 or slightly less ratio of young size to old size. And there's the ever-present (which is why it's often forgotten) advice: you might want to get more physical RAM. It's pretty cheap, and 512MB isn't that much for a server nowadays. Yoav 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Friends. Fun. Try the all-new Yahoo! Messenger. http://messenger.yahoo.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Memory Settings On Tomcat
Thank you, Peter Lin. I wasn't aware of the new status servlet. I'll look into an upgrade. One question: any problems reported with installing Tomcat 5.0.x as a service on Windoze servers? I believe they switched from Alexandria's JavaService to the new Jakarta Daemon for TC 5.0.x. Is that correct, and has that been a seamless transition? Thanks - % --- Peter Lin [EMAIL PROTECTED] wrote: if you can upgrade to tomcat5, I would recommend it. the reason I suggest this is TC5 has the new status servlet, which will tell you how much heap is actually in use currently. the JVM will not release memory back to the OS that is true. in terms of performance the biggest indicator of poor performance is the rate at which the heap grows and the frequency of full GC. Applications that are well behaved should result in regular intervals of full GC. Poor performing applications wiill cause erratic and frequent full GC. Even if you can't upgrade to TC5, it might be worth it to d/l and install it. Once you have it installed, you can use JMeter to view the server load and the memory usage pattern. I hope that helps. peter Michael Duffy [EMAIL PROTECTED] wrote:I recently had a problem with a Windoze server hanging up due to memory problems. I've got Tomcat 4.1.29 installed to run as a service under JDK 1.4.1_05 on this Windows 2000 server. The Tomcat memory settings on startup are -Xms64m and -Xmx1024m. The server has 512MB of physical RAM installed. The Windoze task manager says Tomcat is sitting at ~128MB of memory. My understanding is that Java's garbage collection will reclaim heap-allocated memory to the JVM, but not necessarily to the OS. Is this true? What this means is that a Windoze server admin could look at the task manager and see a large memory usage for Tomcat, but that doesn't necessarily reflect Tomcat's current usage. It's more like a high water mark on a pier: it'll show the highest value that Tomcat has used, but the real value will be lower if the garbage collector runs and the tide goes out. If you read a lot of objects into session you could end up with a big high water mark. The application is a JSP front end with a single controller servlet that interacts with an Oracle database. The only data members in the servlet are some read-only map that are initialized on startup. There are some session data that are maintained for certain user requests, but the rest are all stateless request/response. The server admin is saying that the problem is Windoze memory management. When a new process starts up outside of Tomcat, it could be that memory isn't reachable, and the new process hangs. We're going to increase the virtual page size on Windoze and change the startup settings for the Tomcat service to -Xms256m and -Xmx1536m. So my questions are: (1) Is my understanding of the interaction between the JVM and OS memory management correct? (2) Are there any other tuning settings for Tomcat that I need to look at? Thanks - % __ Do you Yahoo!? Friends. Fun. Try the all-new Yahoo! Messenger. http://messenger.yahoo.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Do you Yahoo!? Friends. Fun. Try the all-new Yahoo! Messenger __ Do you Yahoo!? Friends. Fun. Try the all-new Yahoo! Messenger. http://messenger.yahoo.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Memory Settings On Tomcat
One other factor in upgrading to Tomcat 5.0.x: I'm using JSTL for my app, so that will mean a JSTL 1.1 JAR upgrade, too. I haven't tested anything with it yet. % --- Peter Lin [EMAIL PROTECTED] wrote: if you can upgrade to tomcat5, I would recommend it. the reason I suggest this is TC5 has the new status servlet, which will tell you how much heap is actually in use currently. the JVM will not release memory back to the OS that is true. in terms of performance the biggest indicator of poor performance is the rate at which the heap grows and the frequency of full GC. Applications that are well behaved should result in regular intervals of full GC. Poor performing applications wiill cause erratic and frequent full GC. Even if you can't upgrade to TC5, it might be worth it to d/l and install it. Once you have it installed, you can use JMeter to view the server load and the memory usage pattern. I hope that helps. peter Michael Duffy [EMAIL PROTECTED] wrote:I recently had a problem with a Windoze server hanging up due to memory problems. I've got Tomcat 4.1.29 installed to run as a service under JDK 1.4.1_05 on this Windows 2000 server. The Tomcat memory settings on startup are -Xms64m and -Xmx1024m. The server has 512MB of physical RAM installed. The Windoze task manager says Tomcat is sitting at ~128MB of memory. My understanding is that Java's garbage collection will reclaim heap-allocated memory to the JVM, but not necessarily to the OS. Is this true? What this means is that a Windoze server admin could look at the task manager and see a large memory usage for Tomcat, but that doesn't necessarily reflect Tomcat's current usage. It's more like a high water mark on a pier: it'll show the highest value that Tomcat has used, but the real value will be lower if the garbage collector runs and the tide goes out. If you read a lot of objects into session you could end up with a big high water mark. The application is a JSP front end with a single controller servlet that interacts with an Oracle database. The only data members in the servlet are some read-only map that are initialized on startup. There are some session data that are maintained for certain user requests, but the rest are all stateless request/response. The server admin is saying that the problem is Windoze memory management. When a new process starts up outside of Tomcat, it could be that memory isn't reachable, and the new process hangs. We're going to increase the virtual page size on Windoze and change the startup settings for the Tomcat service to -Xms256m and -Xmx1536m. So my questions are: (1) Is my understanding of the interaction between the JVM and OS memory management correct? (2) Are there any other tuning settings for Tomcat that I need to look at? Thanks - % __ Do you Yahoo!? Friends. Fun. Try the all-new Yahoo! Messenger. http://messenger.yahoo.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Do you Yahoo!? Friends. Fun. Try the all-new Yahoo! Messenger __ Do you Yahoo!? Friends. Fun. Try the all-new Yahoo! Messenger. http://messenger.yahoo.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Memory Settings On Tomcat
I have it running XP Pro and Win2K3 server without any problems, but that's no gaurantee. I'm only using it for stress testing purposes with simple apps, so it's not like I have a a full blown JSTL or Struts app running on it. I think others on the list can provide better information about what kinds of issues you might see. peter Michael Duffy [EMAIL PROTECTED] wrote: Thank you, Peter Lin. I wasn't aware of the new status servlet. I'll look into an upgrade. One question: any problems reported with installing Tomcat 5.0.x as a service on Windoze servers? I believe they switched from Alexandria's JavaService to the new Jakarta Daemon for TC 5.0.x. Is that correct, and has that been a seamless transition? Thanks - % --- Peter Lin wrote: if you can upgrade to tomcat5, I would recommend it. the reason I suggest this is TC5 has the new status servlet, which will tell you how much heap is actually in use currently. the JVM will not release memory back to the OS that is true. in terms of performance the biggest indicator of poor performance is the rate at which the heap grows and the frequency of full GC. Applications that are well behaved should result in regular intervals of full GC. Poor performing applications wiill cause erratic and frequent full GC. Even if you can't upgrade to TC5, it might be worth it to d/l and install it. Once you have it installed, you can use JMeter to view the server load and the memory usage pattern. I hope that helps. peter Michael Duffy wrote:I recently had a problem with a Windoze server hanging up due to memory problems. I've got Tomcat 4.1.29 installed to run as a service under JDK 1.4.1_05 on this Windows 2000 server. The Tomcat memory settings on startup are -Xms64m and -Xmx1024m. The server has 512MB of physical RAM installed. The Windoze task manager says Tomcat is sitting at ~128MB of memory. My understanding is that Java's garbage collection will reclaim heap-allocated memory to the JVM, but not necessarily to the OS. Is this true? What this means is that a Windoze server admin could look at the task manager and see a large memory usage for Tomcat, but that doesn't necessarily reflect Tomcat's current usage. It's more like a high water mark on a pier: it'll show the highest value that Tomcat has used, but the real value will be lower if the garbage collector runs and the tide goes out. If you read a lot of objects into session you could end up with a big high water mark. The application is a JSP front end with a single controller servlet that interacts with an Oracle database. The only data members in the servlet are some read-only map that are initialized on startup. There are some session data that are maintained for certain user requests, but the rest are all stateless request/response. The server admin is saying that the problem is Windoze memory management. When a new process starts up outside of Tomcat, it could be that memory isn't reachable, and the new process hangs. We're going to increase the virtual page size on Windoze and change the startup settings for the Tomcat service to -Xms256m and -Xmx1536m. So my questions are: (1) Is my understanding of the interaction between the JVM and OS memory management correct? (2) Are there any other tuning settings for Tomcat that I need to look at? Thanks - % __ Do you Yahoo!? Friends. Fun. Try the all-new Yahoo! Messenger. http://messenger.yahoo.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Do you Yahoo!? Friends. Fun. Try the all-new Yahoo! Messenger __ Do you Yahoo!? Friends. Fun. Try the all-new Yahoo! Messenger. http://messenger.yahoo.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Do you Yahoo!? Friends. Fun. Try the all-new Yahoo! Messenger
RE: Memory Settings On Tomcat
Peter, Do you have more specifics on this? ...TC5 has the new status servlet, which will tell you how much heap is actually in use currently. I've been using the /manager and jmxpoxy app URL's but I can't find anything which has heap info in it. What am I missing? /manager/list /manager/serverinfo /manager/jmxproxy etc. http://jakarta.apache.org/tomcat/tomcat-5.0-doc/manager-howto.html Thanks, -Dave -Original Message- From: Peter Lin [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 09, 2004 8:12 AM To: Tomcat Users List Subject: Re: Memory Settings On Tomcat if you can upgrade to tomcat5, I would recommend it. the reason I suggest this is TC5 has the new status servlet, which will tell you how much heap is actually in use currently. the JVM will not release memory back to the OS that is true. in terms of performance the biggest indicator of poor performance is the rate at which the heap grows and the frequency of full GC. Applications that are well behaved should result in regular intervals of full GC. Poor performing applications wiill cause erratic and frequent full GC. Even if you can't upgrade to TC5, it might be worth it to d/l and install it. Once you have it installed, you can use JMeter to view the server load and the memory usage pattern. I hope that helps. peter Michael Duffy [EMAIL PROTECTED] wrote:I recently had a problem with a Windoze server hanging up due to memory problems. I've got Tomcat 4.1.29 installed to run as a service under JDK 1.4.1_05 on this Windows 2000 server. The Tomcat memory settings on startup are -Xms64m and -Xmx1024m. The server has 512MB of physical RAM installed. The Windoze task manager says Tomcat is sitting at ~128MB of memory. My understanding is that Java's garbage collection will reclaim heap-allocated memory to the JVM, but not necessarily to the OS. Is this true? What this means is that a Windoze server admin could look at the task manager and see a large memory usage for Tomcat, but that doesn't necessarily reflect Tomcat's current usage. It's more like a high water mark on a pier: it'll show the highest value that Tomcat has used, but the real value will be lower if the garbage collector runs and the tide goes out. If you read a lot of objects into session you could end up with a big high water mark. The application is a JSP front end with a single controller servlet that interacts with an Oracle database. The only data members in the servlet are some read-only map that are initialized on startup. There are some session data that are maintained for certain user requests, but the rest are all stateless request/response. The server admin is saying that the problem is Windoze memory management. When a new process starts up outside of Tomcat, it could be that memory isn't reachable, and the new process hangs. We're going to increase the virtual page size on Windoze and change the startup settings for the Tomcat service to -Xms256m and -Xmx1536m. So my questions are: (1) Is my understanding of the interaction between the JVM and OS memory management correct? (2) Are there any other tuning settings for Tomcat that I need to look at? Thanks - % __ Do you Yahoo!? Friends. Fun. Try the all-new Yahoo! Messenger. http://messenger.yahoo.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Do you Yahoo!? Friends. Fun. Try the all-new Yahoo! Messenger - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Memory Settings On Tomcat
Hi, Go to http://localhost:8080/manager/status and take a look. Yoav Shapira Millennium Research Informatics -Original Message- From: David Muller [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 09, 2004 2:27 PM To: Tomcat Users List Cc: [EMAIL PROTECTED] Subject: RE: Memory Settings On Tomcat Peter, Do you have more specifics on this? ...TC5 has the new status servlet, which will tell you how much heap is actually in use currently. I've been using the /manager and jmxpoxy app URL's but I can't find anything which has heap info in it. What am I missing? /manager/list /manager/serverinfo /manager/jmxproxy etc. http://jakarta.apache.org/tomcat/tomcat-5.0-doc/manager-howto.html Thanks, -Dave -Original Message- From: Peter Lin [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 09, 2004 8:12 AM To: Tomcat Users List Subject: Re: Memory Settings On Tomcat if you can upgrade to tomcat5, I would recommend it. the reason I suggest this is TC5 has the new status servlet, which will tell you how much heap is actually in use currently. the JVM will not release memory back to the OS that is true. in terms of performance the biggest indicator of poor performance is the rate at which the heap grows and the frequency of full GC. Applications that are well behaved should result in regular intervals of full GC. Poor performing applications wiill cause erratic and frequent full GC. Even if you can't upgrade to TC5, it might be worth it to d/l and install it. Once you have it installed, you can use JMeter to view the server load and the memory usage pattern. I hope that helps. peter Michael Duffy [EMAIL PROTECTED] wrote:I recently had a problem with a Windoze server hanging up due to memory problems. I've got Tomcat 4.1.29 installed to run as a service under JDK 1.4.1_05 on this Windows 2000 server. The Tomcat memory settings on startup are -Xms64m and -Xmx1024m. The server has 512MB of physical RAM installed. The Windoze task manager says Tomcat is sitting at ~128MB of memory. My understanding is that Java's garbage collection will reclaim heap-allocated memory to the JVM, but not necessarily to the OS. Is this true? What this means is that a Windoze server admin could look at the task manager and see a large memory usage for Tomcat, but that doesn't necessarily reflect Tomcat's current usage. It's more like a high water mark on a pier: it'll show the highest value that Tomcat has used, but the real value will be lower if the garbage collector runs and the tide goes out. If you read a lot of objects into session you could end up with a big high water mark. The application is a JSP front end with a single controller servlet that interacts with an Oracle database. The only data members in the servlet are some read-only map that are initialized on startup. There are some session data that are maintained for certain user requests, but the rest are all stateless request/response. The server admin is saying that the problem is Windoze memory management. When a new process starts up outside of Tomcat, it could be that memory isn't reachable, and the new process hangs. We're going to increase the virtual page size on Windoze and change the startup settings for the Tomcat service to -Xms256m and -Xmx1536m. So my questions are: (1) Is my understanding of the interaction between the JVM and OS memory management correct? (2) Are there any other tuning settings for Tomcat that I need to look at? Thanks - % __ Do you Yahoo!? Friends. Fun. Try the all-new Yahoo! Messenger. http://messenger.yahoo.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Do you Yahoo!? Friends. Fun. Try the all-new Yahoo! Messenger - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Memory Settings On Tomcat
Hi Yoav, Yes to 1, and likely yes to 2. Check out the different garbage collector implementations, and the directives for setting old and young generation sizes. Your case is a classic one for setting a small old generation size relative to the young generation size: maybe even a 10-1 or slightly less ratio of young size to old size. I've never checked this page out before, but at your prompting I found it today: http://java.sun.com/docs/hotspot/VMOptions.html I believe the docs are telling me that the default value of XX:NewRatio=12 for Intel. Is that correct? If that's true, should I just leave the default? I have no experience with setting any of these values. I've always used the JVM right out of the box (my ignorance). What would be a minimum set of parameters to span this space? Thanks - % --- Shapira, Yoav [EMAIL PROTECTED] wrote: Hi, I've got Tomcat 4.1.29 installed to run as a service under JDK 1.4.1_05 on this Windows 2000 server. The Tomcat memory settings on startup are -Xms64m and -Xmx1024m. The server has 512MB of physical RAM It's not a good idea to set -Xmx to a higher amount than the amount of physical RAM: the JVM will thrash once it reaches much less than 512MB. My understanding is that Java's garbage collection will reclaim heap-allocated memory to the JVM, but not necessarily to the OS. Is this true? What this means is that a Windoze server admin could look at the task manager and see a large memory usage for Tomcat, but that doesn't necessarily reflect Tomcat's current usage. It's more like a high water mark on a pier: it'll show the highest value that Tomcat has used, but the real value will be lower if the garbage collector runs and the tide goes out. If you read a lot of objects into session you could end up with a big high water mark. Your understanding is good and correct on the above issues. (1) Is my understanding of the interaction between the JVM and OS memory management correct? (2) Are there any other tuning settings for Tomcat that I need to look at? Yes to 1, and likely yes to 2. Check out the different garbage collector implementations, and the directives for setting old and young generation sizes. Your case is a classic one for setting a small old generation size relative to the young generation size: maybe even a 10-1 or slightly less ratio of young size to old size. And there's the ever-present (which is why it's often forgotten) advice: you might want to get more physical RAM. It's pretty cheap, and 512MB isn't that much for a server nowadays. Yoav 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Memory Settings On Tomcat
You might want to look at the VM performance numbers in my Performance article. The link is listed on the tomcat resources page. Generally, tweaking the generations takes time. for something, like XML, tweaking generation ratio doesn't help. peter Michael Duffy [EMAIL PROTECTED] wrote: Hi Yoav, Yes to 1, and likely yes to 2. Check out the different garbage collector implementations, and the directives for setting old and young generation sizes. Your case is a classic one for setting a small old generation size relative to the young generation size: maybe even a 10-1 or slightly less ratio of young size to old size. I've never checked this page out before, but at your prompting I found it today: http://java.sun.com/docs/hotspot/VMOptions.html I believe the docs are telling me that the default value of XX:NewRatio=12 for Intel. Is that correct? If that's true, should I just leave the default? I have no experience with setting any of these values. I've always used the JVM right out of the box (my ignorance). What would be a minimum set of parameters to span this space? Thanks - % --- Shapira, Yoav wrote: Hi, I've got Tomcat 4.1.29 installed to run as a service under JDK 1.4.1_05 on this Windows 2000 server. The Tomcat memory settings on startup are -Xms64m and -Xmx1024m. The server has 512MB of physical RAM It's not a good idea to set -Xmx to a higher amount than the amount of physical RAM: the JVM will thrash once it reaches much less than 512MB. My understanding is that Java's garbage collection will reclaim heap-allocated memory to the JVM, but not necessarily to the OS. Is this true? What this means is that a Windoze server admin could look at the task manager and see a large memory usage for Tomcat, but that doesn't necessarily reflect Tomcat's current usage. It's more like a high water mark on a pier: it'll show the highest value that Tomcat has used, but the real value will be lower if the garbage collector runs and the tide goes out. If you read a lot of objects into session you could end up with a big high water mark. Your understanding is good and correct on the above issues. (1) Is my understanding of the interaction between the JVM and OS memory management correct? (2) Are there any other tuning settings for Tomcat that I need to look at? Yes to 1, and likely yes to 2. Check out the different garbage collector implementations, and the directives for setting old and young generation sizes. Your case is a classic one for setting a small old generation size relative to the young generation size: maybe even a 10-1 or slightly less ratio of young size to old size. And there's the ever-present (which is why it's often forgotten) advice: you might want to get more physical RAM. It's pretty cheap, and 512MB isn't that much for a server nowadays. Yoav 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Do you Yahoo!? Friends. Fun. Try the all-new Yahoo! Messenger
RE: Memory Settings On Tomcat
Hi Peter, Hiding in plain sight: http://jakarta.apache.org/tomcat/articles/performance.pdf I apologize for overlooking it for all this time. I'll be sure to go through it right away. Thanks - % --- Peter Lin [EMAIL PROTECTED] wrote: You might want to look at the VM performance numbers in my Performance article. The link is listed on the tomcat resources page. Generally, tweaking the generations takes time. for something, like XML, tweaking generation ratio doesn't help. peter Michael Duffy [EMAIL PROTECTED] wrote: Hi Yoav, Yes to 1, and likely yes to 2. Check out the different garbage collector implementations, and the directives for setting old and young generation sizes. Your case is a classic one for setting a small old generation size relative to the young generation size: maybe even a 10-1 or slightly less ratio of young size to old size. I've never checked this page out before, but at your prompting I found it today: http://java.sun.com/docs/hotspot/VMOptions.html I believe the docs are telling me that the default value of XX:NewRatio=12 for Intel. Is that correct? If that's true, should I just leave the default? I have no experience with setting any of these values. I've always used the JVM right out of the box (my ignorance). What would be a minimum set of parameters to span this space? Thanks - % --- Shapira, Yoav wrote: Hi, I've got Tomcat 4.1.29 installed to run as a service under JDK 1.4.1_05 on this Windows 2000 server. The Tomcat memory settings on startup are -Xms64m and -Xmx1024m. The server has 512MB of physical RAM It's not a good idea to set -Xmx to a higher amount than the amount of physical RAM: the JVM will thrash once it reaches much less than 512MB. My understanding is that Java's garbage collection will reclaim heap-allocated memory to the JVM, but not necessarily to the OS. Is this true? What this means is that a Windoze server admin could look at the task manager and see a large memory usage for Tomcat, but that doesn't necessarily reflect Tomcat's current usage. It's more like a high water mark on a pier: it'll show the highest value that Tomcat has used, but the real value will be lower if the garbage collector runs and the tide goes out. If you read a lot of objects into session you could end up with a big high water mark. Your understanding is good and correct on the above issues. (1) Is my understanding of the interaction between the JVM and OS memory management correct? (2) Are there any other tuning settings for Tomcat that I need to look at? Yes to 1, and likely yes to 2. Check out the different garbage collector implementations, and the directives for setting old and young generation sizes. Your case is a classic one for setting a small old generation size relative to the young generation size: maybe even a 10-1 or slightly less ratio of young size to old size. And there's the ever-present (which is why it's often forgotten) advice: you might want to get more physical RAM. It's pretty cheap, and 512MB isn't that much for a server nowadays. Yoav 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Do you Yahoo!? Friends. Fun. Try the all-new Yahoo! Messenger __ Do you Yahoo!? Friends. Fun. Try the all-new Yahoo! Messenger. http://messenger.yahoo.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Memory Settings On Tomcat
by the way, in case you haven't heard of it, http://mc4j.sourceforge.net/ mc4J can monitor tomcat4 and generate nice graphs. I haven't used it, but it looks nice. peter --- Michael Duffy [EMAIL PROTECTED] wrote: Hi Peter, Hiding in plain sight: http://jakarta.apache.org/tomcat/articles/performance.pdf I apologize for overlooking it for all this time. I'll be sure to go through it right away. Thanks - % --- Peter Lin [EMAIL PROTECTED] wrote: You might want to look at the VM performance numbers in my Performance article. The link is listed on the tomcat resources page. Generally, tweaking the generations takes time. for something, like XML, tweaking generation ratio doesn't help. peter Michael Duffy [EMAIL PROTECTED] wrote: Hi Yoav, Yes to 1, and likely yes to 2. Check out the different garbage collector implementations, and the directives for setting old and young generation sizes. Your case is a classic one for setting a small old generation size relative to the young generation size: maybe even a 10-1 or slightly less ratio of young size to old size. I've never checked this page out before, but at your prompting I found it today: http://java.sun.com/docs/hotspot/VMOptions.html I believe the docs are telling me that the default value of XX:NewRatio=12 for Intel. Is that correct? If that's true, should I just leave the default? I have no experience with setting any of these values. I've always used the JVM right out of the box (my ignorance). What would be a minimum set of parameters to span this space? Thanks - % --- Shapira, Yoav wrote: Hi, I've got Tomcat 4.1.29 installed to run as a service under JDK 1.4.1_05 on this Windows 2000 server. The Tomcat memory settings on startup are -Xms64m and -Xmx1024m. The server has 512MB of physical RAM It's not a good idea to set -Xmx to a higher amount than the amount of physical RAM: the JVM will thrash once it reaches much less than 512MB. My understanding is that Java's garbage collection will reclaim heap-allocated memory to the JVM, but not necessarily to the OS. Is this true? What this means is that a Windoze server admin could look at the task manager and see a large memory usage for Tomcat, but that doesn't necessarily reflect Tomcat's current usage. It's more like a high water mark on a pier: it'll show the highest value that Tomcat has used, but the real value will be lower if the garbage collector runs and the tide goes out. If you read a lot of objects into session you could end up with a big high water mark. Your understanding is good and correct on the above issues. (1) Is my understanding of the interaction between the JVM and OS memory management correct? (2) Are there any other tuning settings for Tomcat that I need to look at? Yes to 1, and likely yes to 2. Check out the different garbage collector implementations, and the directives for setting old and young generation sizes. Your case is a classic one for setting a small old generation size relative to the young generation size: maybe even a 10-1 or slightly less ratio of young size to old size. And there's the ever-present (which is why it's often forgotten) advice: you might want to get more physical RAM. It's pretty cheap, and 512MB isn't that much for a server nowadays. Yoav 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Do you Yahoo!? Friends. Fun. Try the all-new Yahoo! Messenger __ Do you Yahoo!? Friends. Fun. Try the all-new Yahoo! Messenger. http://messenger.yahoo.com/