|
From: Leif M. <le...@ta...> - 2003-07-16 04:52:21
|
Mike, Ouch. You are right about avoiding calling System.gc() Still that is one long lock. You are using quite a bit of memory though. What is the timeout that you are extending? Setting the wrapper.ping.timeout=300 would cause the Wrapper to allow up to 5 minutes for the GC to complete. If that is still a problem then you could set it to 600 (10 minutes) But I would say that you have other problems long before that. You could also set it to 0, but as is described in the docs, I would strongly advise against that as it would disable the Wrapper's ability to detect a frozen JVM. http://wrapper.tanukisoftware.org/doc/english/prop-ping-timeout.html If you don't already know, you might want to play with the profiler to try and figure out what is being GCed. Maybe pooling resources etc could help you to avoid the need to perform garbage collection. In general though I have found that newer JVMs do a very good job of handling GC on their own. Forcing a GC just serves to slow things down. It is usually better to let the JVM decide when it is best to do a GC. The GC that the JVM does is generally must more light weight. It is still taking over a second on your app though. Doing GCs during development can be useful to get the minimum amount of memory that an application needs to run. But it seems to slow things down because the JVM will usually immediately reallocate the memory just freed so that it can run. Cheers, Leif Mike Castle wrote: >Ugh. It looks like GC takes too long sometimes and Wrapper things the JVM >has hung: > >INFO | jvm 1 | 2003/07/15 20:36:49 | [GC >INFO | jvm 1 | 2003/07/15 20:36:50 | 451745K->409600K(506368K), 1.1287680 secs] >INFO | jvm 1 | 2003/07/15 20:36:51 | [Full GC >DEBUG | wrapperp | 2003/07/15 20:36:52 | send a packet 103 : ping >DEBUG | wrapperp | 2003/07/15 20:36:58 | send a packet 103 : ping >DEBUG | wrapperp | 2003/07/15 20:37:04 | send a packet 103 : ping >DEBUG | wrapperp | 2003/07/15 20:37:10 | send a packet 103 : ping >DEBUG | wrapperp | 2003/07/15 20:37:16 | send a packet 103 : ping >ERROR | wrapper | 2003/07/15 20:37:22 | JVM appears hung: Timed out waiting for signal from JVM. >ERROR | wrapper | 2003/07/15 20:37:22 | JVM did not exit on request, terminated > > >Yeah, I am trying to figure out who is calling System.gc() once a second. > >Anyway, since System.gc() causes all other threads to pause until it's >done... and no matter what timeout you set in wrapper's config file, there >will eventually be a case where gc takes just a bit longer... how to handle >this in the general case? Is there anyway? > >Meanwhile, time to figure out who's banging away on gc, read up on GC >tuning, and yell at the developer to not allocate so much shit. :-/ >Any recommendations? > >mrc > > |