AW: HOW TO: How do I allocate memory in JVM for extra virtual hosts
No, that won't help. To call gc() doesn't call the garbage collector, you just set a mark saying 'I would like to do a garbage collection as soon as you like to do it'. Wether and when the garbage collector follows your desire is up to the implementation. -Ursprüngliche Nachricht- Von: Brad Plies [mailto:[EMAIL PROTECTED]] Gesendet: Freitag, 27. September 2002 18:19 An: Tomcat Users List Betreff: Re: HOW TO: How do I allocate memory in JVM for extra virtual hosts I am not aware of all the performance implications of this, but it should be possible to create a Thread to run on some interval you define which just infinitely loops a call for garbage collection (gc() right?) then goes back to sleep until next iteration. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: HOW TO: How do I allocate memory in JVM for extra virtual hosts
Hi, Check out perc 3.3 at http://www.newmonics.com/info/gc.shtml, it has a pretty decent GC performing much better than Sun's. Also IBM's JVM is pretty good too. Please define performing much better ? For our app benchmarks, JDK 1.4 GC was substantially better than PERC 3.3. I love how the PERC page still says generational garbage collection like it's a big new thing. Have you experimented with the train and concurrent parallel GCs in JDK 1.4 and compared them (seriously compared them, with hprof / another profiler and/or a heap analyzer)? I am not aware of all the performance implications of this, but it should be possible to create a Thread to run on some interval you define which just infinitely loops a call for garbage collection (gc() right?) then goes back to sleep until next iteration. System.gc() is a suggestion. It doesn't guarantee GC will run. You don't want to do it anyways. The JDK internally is better at detecting when to run GC and what type of GC to do, on what segment. Spend your time tuning the parameters, e.g. Xmx, Xms, XX:NewSize, XX:MaxNewSize, min and max free percentages, etc. Analyze the results seriously, don't go for seat of the pants, this seems better testing. FYI, we have several large (1G heaps) JVMs. We have run into long GCes in the past, until we just set aside several weeks to researching and tuning the GC. The results were excellent. As mentioned above, it was then that we experimented with alternative JDKs, including IBM, PERK, jRockit, and others. At least then you can control how often garbage collection happens, and I suppose it is possible that No you don't control it. It's only a suggestion. In fact, JDK 1.4 supports a switch that says to completely ignore System.gc() calls, so if you server admin uses this switch System.gc() does nothing. To get started, see: http://java.sun.com/docs/hotspot/gc/index.html http://java.sun.com/docs/hotspot/VMOptions.html http://wireless.java.sun.com/midp/articles/garbage/ Good luck, 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: HOW TO: How do I allocate memory in JVM for extra virtual hosts
Thanks for that. We are currently analysing the problem and we will look seriously at JDK 1.4 and probably IBM's JDK. We obviously have some work to do but as our app depends on it we are happy to look into these issues. Thanks for all the pointers Donie -Original Message- From: Shapira, Yoav [mailto:[EMAIL PROTECTED]] Sent: 30 September 2002 13:22 To: Tomcat Users List Subject: RE: HOW TO: How do I allocate memory in JVM for extra virtual hosts Hi, Check out perc 3.3 at http://www.newmonics.com/info/gc.shtml, it has a pretty decent GC performing much better than Sun's. Also IBM's JVM is pretty good too. Please define performing much better ? For our app benchmarks, JDK 1.4 GC was substantially better than PERC 3.3. I love how the PERC page still says generational garbage collection like it's a big new thing. Have you experimented with the train and concurrent parallel GCs in JDK 1.4 and compared them (seriously compared them, with hprof / another profiler and/or a heap analyzer)? I am not aware of all the performance implications of this, but it should be possible to create a Thread to run on some interval you define which just infinitely loops a call for garbage collection (gc() right?) then goes back to sleep until next iteration. System.gc() is a suggestion. It doesn't guarantee GC will run. You don't want to do it anyways. The JDK internally is better at detecting when to run GC and what type of GC to do, on what segment. Spend your time tuning the parameters, e.g. Xmx, Xms, XX:NewSize, XX:MaxNewSize, min and max free percentages, etc. Analyze the results seriously, don't go for seat of the pants, this seems better testing. FYI, we have several large (1G heaps) JVMs. We have run into long GCes in the past, until we just set aside several weeks to researching and tuning the GC. The results were excellent. As mentioned above, it was then that we experimented with alternative JDKs, including IBM, PERK, jRockit, and others. At least then you can control how often garbage collection happens, and I suppose it is possible that No you don't control it. It's only a suggestion. In fact, JDK 1.4 supports a switch that says to completely ignore System.gc() calls, so if you server admin uses this switch System.gc() does nothing. To get started, see: http://java.sun.com/docs/hotspot/gc/index.html http://java.sun.com/docs/hotspot/VMOptions.html http://wireless.java.sun.com/midp/articles/garbage/ Good luck, Yoav Shapira Millennium ChemInformatics -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: HOW TO: How do I allocate memory in JVM for extra virtual hosts
Check out perc 3.3 at http://www.newmonics.com/info/gc.shtml, it has a pretty decent GC performing much better than Sun's. Also IBM's JVM is pretty good too. -Original Message- From: Brad Plies To: Tomcat Users List Sent: 9/27/02 12:18 PM Subject: Re: HOW TO: How do I allocate memory in JVM for extra virtual hosts I am not aware of all the performance implications of this, but it should be possible to create a Thread to run on some interval you define which just infinitely loops a call for garbage collection (gc() right?) then goes back to sleep until next iteration. At least then you can control how often garbage collection happens, and I suppose it is possible that doing it more regularly could imply less stuff needs to be collected each iteration, than to wait for the JVM to get the GC going. Then again, maybe a GC awakening, no matter how little the work, is a very expensive process. I don't know. Anyway, if you absolutely need that kind of performance, I do believe there are licenses available for Realtime Garbage Collection engines. At least Dr. Mark Johnstone did his dissertation on them, so I assume they exist somewhere. --- Donie Kelly [EMAIL PROTECTED] wrote: Hi all I am running tomcat 4.0.1 with virtual hosting and was wondering how much memory to allocate to each additional host. By default, we use 64M for one host but adding another 64M for second host seems excessive considering it's the same tomcat instance. However, if we add a lot the JVM will use more memory before garbage collection and we've seen a 30 second (!!!) delay when using 1G Ram on JVM as it just kept using memory until it ran out. It then had almost 1G of ram to garbage collect. How can I force garbage collection to be more aggressive and do it more often when garbage is small enough not to cause a problem? As we need this to run in a production environment we cannot possible allow a JVM to go for a garbage break for 30 seconds Any insight or help is greatly appreciated. Donie -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] __ Do you Yahoo!? New DSL Internet Access from SBC Yahoo! http://sbc.yahoo.com -- 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]
HOW TO: How do I allocate memory in JVM for extra virtual hosts
Hi all I am running tomcat 4.0.1 with virtual hosting and was wondering how much memory to allocate to each additional host. By default, we use 64M for one host but adding another 64M for second host seems excessive considering it's the same tomcat instance. However, if we add a lot the JVM will use more memory before garbage collection and we've seen a 30 second (!!!) delay when using 1G Ram on JVM as it just kept using memory until it ran out. It then had almost 1G of ram to garbage collect. How can I force garbage collection to be more aggressive and do it more often when garbage is small enough not to cause a problem? As we need this to run in a production environment we cannot possible allow a JVM to go for a garbage break for 30 seconds Any insight or help is greatly appreciated. Donie -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
AW: HOW TO: How do I allocate memory in JVM for extra virtual hosts
Depends on the vendor and the version of the vm. 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 -Ursprüngliche Nachricht- Von: Donie Kelly [mailto:[EMAIL PROTECTED]] Gesendet: Freitag, 27. September 2002 12:12 An: 'Tomcat Users List' Betreff: HOW TO: How do I allocate memory in JVM for extra virtual hosts How can I force garbage collection to be more aggressive and do it more often when garbage is small enough not to cause a problem? -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: HOW TO: How do I allocate memory in JVM for extra virtual hosts
There are several things you can do (on 1.3.1 and after): 1. Make sure your global and local class parms are explicitly set to null after the work is being completed 2. Heavily used classes should provide their own finalize methods 3. You will need to call JVM to run finalization and recommend JVM to run the GC. (System.runFinalization() and System.gc() ). However, be very careful with these methods since specially System.runFinalization() might clean up the objects that you still need. 4. Use -server option for HotSpot since it's GC is much better than regular GC 5. If all above does not work, then try using java.lang.ref.Reference package to explicitly define your reference types so they would easily be collected by the GC (weak references, unreachable object etc.) 6. do NOT set Xmx and Xms to same value 7. Look at -XX options of the JVM and do more reading abouts eden, young, old generations. Some options are XX:SurvivorRatio and XX:SoftRefLRUPolicyMSPerMB -Original Message- From: Donie Kelly To: 'Tomcat Users List' Sent: 9/27/02 6:12 AM Subject: HOW TO: How do I allocate memory in JVM for extra virtual hosts Hi all I am running tomcat 4.0.1 with virtual hosting and was wondering how much memory to allocate to each additional host. By default, we use 64M for one host but adding another 64M for second host seems excessive considering it's the same tomcat instance. However, if we add a lot the JVM will use more memory before garbage collection and we've seen a 30 second (!!!) delay when using 1G Ram on JVM as it just kept using memory until it ran out. It then had almost 1G of ram to garbage collect. How can I force garbage collection to be more aggressive and do it more often when garbage is small enough not to cause a problem? As we need this to run in a production environment we cannot possible allow a JVM to go for a garbage break for 30 seconds Any insight or help is greatly appreciated. Donie -- 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: HOW TO: How do I allocate memory in JVM for extra virtual hosts
I am not aware of all the performance implications of this, but it should be possible to create a Thread to run on some interval you define which just infinitely loops a call for garbage collection (gc() right?) then goes back to sleep until next iteration. At least then you can control how often garbage collection happens, and I suppose it is possible that doing it more regularly could imply less stuff needs to be collected each iteration, than to wait for the JVM to get the GC going. Then again, maybe a GC awakening, no matter how little the work, is a very expensive process. I don't know. Anyway, if you absolutely need that kind of performance, I do believe there are licenses available for Realtime Garbage Collection engines. At least Dr. Mark Johnstone did his dissertation on them, so I assume they exist somewhere. --- Donie Kelly [EMAIL PROTECTED] wrote: Hi all I am running tomcat 4.0.1 with virtual hosting and was wondering how much memory to allocate to each additional host. By default, we use 64M for one host but adding another 64M for second host seems excessive considering it's the same tomcat instance. However, if we add a lot the JVM will use more memory before garbage collection and we've seen a 30 second (!!!) delay when using 1G Ram on JVM as it just kept using memory until it ran out. It then had almost 1G of ram to garbage collect. How can I force garbage collection to be more aggressive and do it more often when garbage is small enough not to cause a problem? As we need this to run in a production environment we cannot possible allow a JVM to go for a garbage break for 30 seconds Any insight or help is greatly appreciated. Donie -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] __ Do you Yahoo!? New DSL Internet Access from SBC Yahoo! http://sbc.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: HOW TO: How do I allocate memory in JVM for extra virtual hosts
Brad Plies wrote: I am not aware of all the performance implications of this, but it should be possible to create a Thread to run on some interval you define which just infinitely loops a call for garbage collection (gc() right?) then goes back to sleep until next iteration. This is a very bad idea. The JVM is much better at knowing when and how to do GC. Especially the newer JVM's with HotSpot. Regards, Glenn -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]