Vedr.: Garbage Collection issues
Without knowing your system setup especially JDK version, RAM and # of processors my guess is that it could be due to an undersized heap and a high call-setup rate. If the pressure on the old collector is heavy enough, it can force the old collector to revert to the traditional mark-sweep collector. If the old collector is still unable to keep up, the system can begin to thrash, and finally, throw an out-of-memory exception. Start Tomcat with verbose/xloggc to profile your applications. /Thomas Neal [EMAIL PROTECTED] 01-12-03 02:21 Besvar venligst til Tomcat Users List Til:'Tomcat Users List' [EMAIL PROTECTED] cc: Vedr.: Garbage Collection issues My Tomcat 4.1 (hosted on Linux) seems to have a problem in recent months with crashing due to unavailable free RAM. Specifically I get a java.error.outOfMemory exception. If check the RAM available (Runtime.getRuntime().totalMemory()), I can see it ticking down through the week. If explicitly run garbage collection however my RAM totally frees up and all is well (Runtime.getRuntime().gc();). Why would this happen? Surely this isn't due to a programming error on my part, otherwise, the resources should automatically released whenever the JRE performs periodic garbage collection. Isn't that correct? Anyone have any theories as to what this may mean and what the best solution would be? Thanks. Neal - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] FONT SIZE=1 FACE=Arial___ Vi goer opmaerksom paa, at denne e-mail kan indeholde fortrolig information. Hvis du ved en fejltagelse modtager e-mailen, beder vi dig venligst informere afsender om fejlen ved at bruge svar-funktionen. Samtidig beder vi dig slette e-mailen i dit system uden at videresende eller kopiere den. Selv om e-mailen og ethvert vedhaeftet bilag efter vores overbevisning er fri for virus og andre fejl, som kan paavirke computeren eller it-systemet, hvori den modtages og laeses, aabnes den paa modtagerens eget ansvar. Vi paatager os ikke noget ansvar for tab og skade, som er opstaaet i forbindelse med at modtage og bruge e-mailen. ___ Please note that this message may contain confidential information. If you have received this message by mistake, please inform the sender of the mistake by sending a reply, then delete the message from your system without making, distributing or retaining any copies of it. Although we believe that the message and any attachments are free from viruses and other errors that might affect the computer or IT system where it is received and read, the recipient opens the message at his or her own risk. We assume no responsibility for any loss or damage arising from the receipt or use of this message. /FONT
RE: Garbage Collection issues
Howdy, Perhaps you are experiencing higher load, which requires more memory. Or perhaps your application does have a memory leak: those are possible and occur in java, so yes that would a programming error on your part. The garbage collector does much magic, but it can't save you all the time. You may wish to read up on java memory leaks, as they've been discussed at length on this list and on the net in general. Note that when you call Runtime#gc that's only a suggestion to the JVM: many times when you call that the garbage collector may not run at all. Yoav Shapira Millennium ChemInformatics -Original Message- From: Neal [mailto:[EMAIL PROTECTED] Sent: Sunday, November 30, 2003 8:21 PM To: 'Tomcat Users List' Subject: Garbage Collection issues My Tomcat 4.1 (hosted on Linux) seems to have a problem in recent months with crashing due to unavailable free RAM. Specifically I get a java.error.outOfMemory exception. If check the RAM available (Runtime.getRuntime().totalMemory()), I can see it ticking down through the week. If explicitly run garbage collection however my RAM totally frees up and all is well (Runtime.getRuntime().gc();). Why would this happen? Surely this isn't due to a programming error on my part, otherwise, the resources should automatically released whenever the JRE performs periodic garbage collection. Isn't that correct? Anyone have any theories as to what this may mean and what the best solution would be? Thanks. Neal - 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: Garbage Collection issues
When I said that surely it can't be a memory leak in my app I was operating under the assumption that the JRE runs garbage collection periodically anywayis this not true? If I was waisting resources and not releasing them in a way that the GC could take them back when it runs automatically then why would it take them back when I call garbage collection explicitly? To me, this suggested more of a systemic issue. It was suggested by someone last night that I may want to look at some config lines to make sure GC is active and this seemed in line with my assumption. Is there something else here that I may be missing however? Can you see a possible explanation as to why my app's waisted resources would not get cleaned up until I explicitly ran GC? Thanks. Neal Shapira, Yoav [EMAIL PROTECTED] wrote: Howdy, Perhaps you are experiencing higher load, which requires more memory. Or perhaps your application does have a memory leak: those are possible and occur in java, so yes that would a programming error on your part. The garbage collector does much magic, but it can't save you all the time. You may wish to read up on java memory leaks, as they've been discussed at length on this list and on the net in general. Note that when you call Runtime#gc that's only a suggestion to the JVM: many times when you call that the garbage collector may not run at all. Yoav Shapira Millennium ChemInformatics -Original Message- From: Neal [mailto:[EMAIL PROTECTED] Sent: Sunday, November 30, 2003 8:21 PM To: 'Tomcat Users List' Subject: Garbage Collection issues My Tomcat 4.1 (hosted on Linux) seems to have a problem in recent months with crashing due to unavailable free RAM. Specifically I get a java.error.outOfMemory exception. If check the RAM available (Runtime.getRuntime().totalMemory()), I can see it ticking down through the week. If explicitly run garbage collection however my RAM totally frees up and all is well (Runtime.getRuntime().gc();). Why would this happen? Surely this isn't due to a programming error on my part, otherwise, the resources should automatically released whenever the JRE performs periodic garbage collection. Isn't that correct? Anyone have any theories as to what this may mean and what the best solution would be? Thanks. Neal - 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] - Do you Yahoo!? Free Pop-Up Blocker - Get it now
Re: Garbage Collection issues
Neal, When I said that surely it can't be a memory leak in my app I was operating under the assumption that the JRE runs garbage collection periodically anywayis this not true? The GC is pretty much free to run whenever it wants. Often, it will not run until you get very close to running out of memory. Actually, most modern GCs run all the time, but do very little work. They free-up short-leved objects and only re-claim a very small amount of memory. After some longer-lived (and dead) objects accumulate on the heap, then the GC does a full GC and the heap goes *way* down (this is likely to be what you see when you force a GC). If I was waisting resources and not releasing them in a way that the GC could take them back when it runs automatically then why would it take them back when I call garbage collection explicitly? Did this forced GC helps situation happen in a dev environment or in production? To me, this suggested more of a systemic issue. It was suggested by someone last night that I may want to look at some config lines to make sure GC is active and this seemed in line with my assumption. Is there something else here that I may be missing however? Can you see a possible explanation as to why my app's wasted resources would not get cleaned up until I explicitly ran GC? As I said, sometimes the GC takes it's sweet time. What, if any, memory settings do you use, and do you use any GC specific settings? For debugging purposes, it's often helpful to enable verbose GC -- check your VM's command-line options for how to enable that. Many production deployments set both the min and max heap sizes to the same power-of-two setting (i.e. 128M, 256M, 1024M, etc.) -chris - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Garbage Collection issues
My Tomcat 4.1 (hosted on Linux) seems to have a problem in recent months with crashing due to unavailable free RAM. Specifically I get a java.error.outOfMemory exception. If check the RAM available (Runtime.getRuntime().totalMemory()), I can see it ticking down through the week. If explicitly run garbage collection however my RAM totally frees up and all is well (Runtime.getRuntime().gc();). Why would this happen? Surely this isn't due to a programming error on my part, otherwise, the resources should automatically released whenever the JRE performs periodic garbage collection. Isn't that correct? Anyone have any theories as to what this may mean and what the best solution would be? Thanks. Neal - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]