Class loader and garbage collector
I've seen that Spring defines a *org.springframework.web.util.IntrospectorCleanupListener * which flushes the bean introspector which may hold cached references to classes to be garbage collected. In tomcat 5.5.7, using jconsole, I've seen that using the IntrospectorCleanupListener is not enough. The number of loaded classes keep increasing when reloading a webapp. The jconsole only shows the number of loaded classes. Is there any way to see which classes are still referenced so that I can further investigate the problem? /roberto -- Roberto Cosenza Infoflex Connect AB, Sweden Tel: +46-(0)8-55576860, Fax: +46-(0)8-55576861 -- Nordic Messaging Technologies is a trademark of Infoflex Connect. Please visit www.nordicmessaging.se for more information about our carrier-grade messaging products. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Garbage Collector
Hi everybody, What's the best / simplest way to implement a garbage collector that starts running as soon as the web application (Tomcat) is up? In my particular case, this garbage collector cleans certain records meeting a certain criteria. The idea is quite simple: every n seconds, the GC performs the corresponding query and deletes the records returned by it. I remember Weblogic having something like startup-classes that would be exactly what I'm needing. Is there something similar in Tomcat? If not, what would be the best / simplest way to implement this? I've thought about a few options but none of them seem clean / efficient enough for me... Let me hear those thoughts! Thanks in advance, Freddy. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Garbage Collector
Freddy Villalba Arias wrote: What's the best / simplest way to implement a garbage collector that starts running as soon as the web application (Tomcat) is up? I think this calls for a ServletContextListener. Start your reaper thread in contextInitialized and kill it in contextDestroyed. http://java.sun.com/products/servlet/2.3/javadoc/javax/servlet/ServletContextListener.html Cheers, -- simon colston - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Garbage Collector
Whoa, it was so obvious I almost feel stupid! Thanks, Simon! -Mensaje original- De: simon colston [mailto:[EMAIL PROTECTED] Enviado el: viernes, 09 de julio de 2004 11:07 Para: Tomcat Users List Asunto: Re: Garbage Collector Freddy Villalba Arias wrote: What's the best / simplest way to implement a garbage collector that starts running as soon as the web application (Tomcat) is up? I think this calls for a ServletContextListener. Start your reaper thread in contextInitialized and kill it in contextDestroyed. http://java.sun.com/products/servlet/2.3/javadoc/javax/servlet/ServletCo ntextListener.html Cheers, -- simon colston - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Garbage collector
I was wondering if anyone had a preference in which garbage collector to use. I am currently using -XX:+UseConcMarkSweepGC but I was wondering which would be considered the best or most commonly used. Thanks
AW: Garbage collector
Hi Rob, I tried using the incremental gc mode which - in my case - led to a worse result than using the default gc mode. Currently I'm using the default mode for our production application and I'm not having any problems with it. But as with any other configuration I'm sure there is no best way (and the most commonly used one is probably the default one). Maybe tools like JMeter or OptimizeIt will help you find the mode which fits your needs best... Regards, Thomas -Ursprüngliche Nachricht- Von: Rob Wichterman [mailto:[EMAIL PROTECTED] Gesendet: Montag, 22. März 2004 16:08 An: [EMAIL PROTECTED] Betreff: Garbage collector I was wondering if anyone had a preference in which garbage collector to use. I am currently using -XX:+UseConcMarkSweepGC but I was wondering which would be considered the best or most commonly used. Thanks - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: When does tomcat call the garbage collector?
You could set up a context or lifecycle listener. Then, when you shut down Tomcat you could close your connections in the respective contextDestroyed method or stop method. Subir -Original Message- From: Filip Hanik [mailto:[EMAIL PROTECTED] Sent: Friday, September 26, 2003 12:15 PM To: Tomcat Users List Subject: Re: When does tomcat call the garbage collector? it is your own responsibility to close connections from a pool. Tomcat doesn't do garbage collection, the Java VM does. Also, if you kill your VM and the connections are still open on the AS400 box, tough luck, (I would imagine they should timeout shortly) that is out of reach from the VM/Tomcat side, best thing you can do is to not keep a pool of open connections, because if the VM crashes or gets killed, there will be no one closing them from the client Filip - Original Message - From: Bruce W. Marriner [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Friday, September 26, 2003 12:10 PM Subject: When does tomcat call the garbage collector? Hello I am working on a crm web app in jsp. I am pre-compiling everything with ant and serving them as servlets though tomcat. I am curious when tomcat does garbage collection on the servlets. For instance, if a servlet opens stuff up I would imagen when that page has finished executing it would clean up anything not properly cleaned up. The real issue... I have a dbHandler class that takes care of sql statements and connection pooling. I am using IBM's AS400JDBCConnectionPool class to handle the pool. If it has say 100 connections open, and you shutdown tomcat. They stay open on the AS400. I would think that some process would go though and close everything that is open when tomcat shuts down. I am compiling with JDK1.4.2_09 and running Tomcat 4.1.27 which is using JRE1.4.2 to execute the servlets. Any ideas would be helpful, thanks. Bruce Marriner - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: When does tomcat call the garbage collector?
Hello, In that case, you'd want to write a class that implements javax.servlet.ServletContextListener to manually shutdown your pool classes when the webapp is stopped. This is handy for webapp reloads during development, too. - Mike Johnson On Fri, 2003-09-26 at 12:34, Bruce W. Marriner wrote: For some reason I figured when tomcat shutdown, along with the JVM -- it would finalize any open classes. And with that action it would close the open connections. Yes the open connections will die after a set value, some x odd hours. It is rather easy to control the number of pooled connection and close them while tomcat is running. But it's the shutdown part I'm concerned about. But when 200 some odd users are using an app it's rather slow to run everyone off a single DB connection :). Is there some way to tell JVM to finalize all open classes at exit? Some command-line argument or com call, or something... -Original Message- From: Filip Hanik [mailto:[EMAIL PROTECTED] Sent: Friday, September 26, 2003 2:15 PM To: Tomcat Users List Subject: Re: When does tomcat call the garbage collector? it is your own responsibility to close connections from a pool. Tomcat doesn't do garbage collection, the Java VM does. Also, if you kill your VM and the connections are still open on the AS400 box, tough luck, (I would imagine they should timeout shortly) that is out of reach from the VM/Tomcat side, best thing you can do is to not keep a pool of open connections, because if the VM crashes or gets killed, there will be no one closing them from the client Filip - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
When does tomcat call the garbage collector?
Hello I am working on a crm web app in jsp. I am pre-compiling everything with ant and serving them as servlets though tomcat. I am curious when tomcat does garbage collection on the servlets. For instance, if a servlet opens stuff up I would imagen when that page has finished executing it would clean up anything not properly cleaned up. The real issue... I have a dbHandler class that takes care of sql statements and connection pooling. I am using IBM's AS400JDBCConnectionPool class to handle the pool. If it has say 100 connections open, and you shutdown tomcat. They stay open on the AS400. I would think that some process would go though and close everything that is open when tomcat shuts down. I am compiling with JDK1.4.2_09 and running Tomcat 4.1.27 which is using JRE1.4.2 to execute the servlets. Any ideas would be helpful, thanks. Bruce Marriner - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: When does tomcat call the garbage collector?
it is your own responsibility to close connections from a pool. Tomcat doesn't do garbage collection, the Java VM does. Also, if you kill your VM and the connections are still open on the AS400 box, tough luck, (I would imagine they should timeout shortly) that is out of reach from the VM/Tomcat side, best thing you can do is to not keep a pool of open connections, because if the VM crashes or gets killed, there will be no one closing them from the client Filip - Original Message - From: Bruce W. Marriner [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Friday, September 26, 2003 12:10 PM Subject: When does tomcat call the garbage collector? Hello I am working on a crm web app in jsp. I am pre-compiling everything with ant and serving them as servlets though tomcat. I am curious when tomcat does garbage collection on the servlets. For instance, if a servlet opens stuff up I would imagen when that page has finished executing it would clean up anything not properly cleaned up. The real issue... I have a dbHandler class that takes care of sql statements and connection pooling. I am using IBM's AS400JDBCConnectionPool class to handle the pool. If it has say 100 connections open, and you shutdown tomcat. They stay open on the AS400. I would think that some process would go though and close everything that is open when tomcat shuts down. I am compiling with JDK1.4.2_09 and running Tomcat 4.1.27 which is using JRE1.4.2 to execute the servlets. Any ideas would be helpful, thanks. Bruce Marriner - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: When does tomcat call the garbage collector?
For some reason I figured when tomcat shutdown, along with the JVM -- it would finalize any open classes. And with that action it would close the open connections. Yes the open connections will die after a set value, some x odd hours. It is rather easy to control the number of pooled connection and close them while tomcat is running. But it's the shutdown part I'm concerned about. But when 200 some odd users are using an app it's rather slow to run everyone off a single DB connection :). Is there some way to tell JVM to finalize all open classes at exit? Some command-line argument or com call, or something... -Original Message- From: Filip Hanik [mailto:[EMAIL PROTECTED] Sent: Friday, September 26, 2003 2:15 PM To: Tomcat Users List Subject: Re: When does tomcat call the garbage collector? it is your own responsibility to close connections from a pool. Tomcat doesn't do garbage collection, the Java VM does. Also, if you kill your VM and the connections are still open on the AS400 box, tough luck, (I would imagine they should timeout shortly) that is out of reach from the VM/Tomcat side, best thing you can do is to not keep a pool of open connections, because if the VM crashes or gets killed, there will be no one closing them from the client Filip - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Manage the garbage collector in tomcat
Hello , I want to modify the action of garbage collector. Where can I change this values (-Xms, -Xmx,-Xminf, etc.)? or I have to modify the scripts where you call %JAVA_HOME%? Thanks a lot for the time . -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
RE: Manage the garbage collector in tomcat
In Tomcat 3 you set TOMCAT_OPTS, Tomcat 4 CATALINA_OPTS. On Windows this would be something like: SET TOMCAT_OPTS=-Xms128M -Xmx2048M and these will get passed to the JVM at Tomcat startup. Randy -Original Message- From: Emilio Miranda [mailto:[EMAIL PROTECTED]] Sent: Friday, February 08, 2002 12:54 PM To: Tomcat Users List Subject: Manage the garbage collector in tomcat Hello , I want to modify the action of garbage collector. Where can I change this values (-Xms, -Xmx,-Xminf, etc.)? or I have to modify the scripts where you call %JAVA_HOME%? Thanks a lot for the time . -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
RE: Manage the garbage collector in tomcat
ok I have tomcat 4.0 if I understand you mean that I have to set environment variable with TOMCAT_OPTS ? or CATALINA_OPTS Really apreciate if you could help in that. -Mensaje original- De: Randy Layman [mailto:[EMAIL PROTECTED]] Enviado el: viernes, 08 de febrero de 2002 12:11 Para: 'Tomcat Users List' Asunto: RE: Manage the garbage collector in tomcat In Tomcat 3 you set TOMCAT_OPTS, Tomcat 4 CATALINA_OPTS. On Windows this would be something like: SET TOMCAT_OPTS=-Xms128M -Xmx2048M and these will get passed to the JVM at Tomcat startup. Randy -Original Message- From: Emilio Miranda [mailto:[EMAIL PROTECTED]] Sent: Friday, February 08, 2002 12:54 PM To: Tomcat Users List Subject: Manage the garbage collector in tomcat Hello , I want to modify the action of garbage collector. Where can I change this values (-Xms, -Xmx,-Xminf, etc.)? or I have to modify the scripts where you call %JAVA_HOME%? Thanks a lot for the time . -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
RE: Manage the garbage collector in tomcat
CATALINA_OPTS -Original Message- From: Emilio Miranda [mailto:[EMAIL PROTECTED]] Sent: Friday, February 08, 2002 1:07 PM To: Tomcat Users List Subject: RE: Manage the garbage collector in tomcat ok I have tomcat 4.0 if I understand you mean that I have to set environment variable with TOMCAT_OPTS ? or CATALINA_OPTS Really apreciate if you could help in that. -Mensaje original- De: Randy Layman [mailto:[EMAIL PROTECTED]] Enviado el: viernes, 08 de febrero de 2002 12:11 Para: 'Tomcat Users List' Asunto: RE: Manage the garbage collector in tomcat In Tomcat 3 you set TOMCAT_OPTS, Tomcat 4 CATALINA_OPTS. On Windows this would be something like: SET TOMCAT_OPTS=-Xms128M -Xmx2048M and these will get passed to the JVM at Tomcat startup. Randy -Original Message- From: Emilio Miranda [mailto:[EMAIL PROTECTED]] Sent: Friday, February 08, 2002 12:54 PM To: Tomcat Users List Subject: Manage the garbage collector in tomcat Hello , I want to modify the action of garbage collector. Where can I change this values (-Xms, -Xmx,-Xminf, etc.)? or I have to modify the scripts where you call %JAVA_HOME%? Thanks a lot for the time . -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Manage of memory and Garbage collector.
Hello, maybe is an off-topic but could anybody tell me how could I know the value of parameters like Xms , MaxPermSize, Xminf, New Ratio , etc. which are involve with the garbage collector -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: Manage of memory and Garbage collector.
you can set what they are with an environment variable. which one depends on the version of tomcat you are running. this is in the docs. matt - Original Message - From: Emilio Miranda [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Friday, February 08, 2002 5:38 PM Subject: Manage of memory and Garbage collector. Hello, maybe is an off-topic but could anybody tell me how could I know the value of parameters like Xms , MaxPermSize, Xminf, New Ratio , etc. which are involve with the garbage collector -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]