> -----Original Message-----
> From: Halfmann, Klaus [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, March 05, 2002 2:45 AM
> To: Tomcat Users List
> Cc: [EMAIL PROTECTED]
> Subject: RE: runaway process in java while using tomcat
> 
> 
> 
> [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] wrote :
> 
> > I am hoping someone can help me with this problem I am having.
> > I am using tomcat 4.0.1 to run a web site with jsps. This 
> > site uses alot of database connecting with Informix.
> > For some reason, usually within 2 hours of starting up 
> > tomcat, a process will start to take up 100% of the CPU.
> > The time it takes for this to happen varies.  
> 
> With Linux every JavaThread looks like a process of its own
> (other as with e.g.  Solaris). So your runaway task should
> normally be a Java Thread. To Monitor your application you 
> could try to periodically dump the names and Status of all
> Threads.  Threads created by your code should have reasonable 
> names.
> 
> Another Problem might be the Informix driver. Eventually due
> to some bad SQL you might receive an "infinite" amount of Data
> or the Driver may produce an infinite loop. Try logging
> all sql statements and have a look at them.

Another thought might be are you encountering some form of deadlock on the
database?  (Using transactions and thread 1 holds a lock on an object thread
2 needs and thread 2 holds a lock on an object thread 1 needs.)  The
Informix management software should be able to give you a list of all
connections and what they are doing.  If it doesn't seem obvious what is
happening, try randomly killing them off to see if the problem goes away.
If it does you will know the problem is somewhere in your database logic.
Depending upon how your error reporting works, you might even know where the
problem is (server dropping a connection generally a SQLException).
> 
> How is the memory consumption of you application when it "runs
> away" ? It may be that the Server is trashing and wasting its
> time with GCs. You might wish to reduce the number of Threads
> in your server.xml in this case.

This is also a possibility.  You can use top to capture current memory
usage.  Also, you can use top to determine the number of thread in the jvm
that is causing a problem.  If its one then you have some kind of loop, two
or more implies a threading problem where things are doing a busy wait for
something to happen.

> 
> Try writing HTTPUnit Testcases to stress your pages.
> ( http://sourceforge.net/project/showfiles.php?group_id=6550)
> You might want to create something like a "crawler" that
> follows every link and "presses" every button.
> 
> As a last resort you could use a debugger (jdb should do) and
> try to find out about your Application this way.
> 

I think what most everyone is going to say is - we haven't seen this problem
caused by Tomcat.  We might have caused something like this ourselves, but
not Tomcat.

        Randy

--
To unsubscribe:   <mailto:[EMAIL PROTECTED]>
For additional commands: <mailto:[EMAIL PROTECTED]>
Troubles with the list: <mailto:[EMAIL PROTECTED]>

Reply via email to