RE: Tomcat service crashes unexpectedly, no trace in logs

2005-01-17 Thread David Vandaele
Hi Greg,

Thanks, great idea, I'm certainly going to try it out asap.  However, at this 
point I don't think we're chasing the same problem (correct me if I'm wrong): 
In your case there is not really a crash, as opposed to my situation where I 
can see a message in the Windows Event Log + I also found a DrWatson dump 
(user.dump)

I've browsed through the DrWatson dump-file, but there doesn't seem to be much 
useful information in there.  Of course, I can really say this being an expert 
in analysing binary data in dump files and all :-)

Seriously though, could there be perhaps some indicators I can use to be sure 
this is either a Jvm XOR a Tomcat problem ? 

David

-Original Message-
From: Greg Lappen [mailto:[EMAIL PROTECTED]
Sent: vrijdag 14 januari 2005 22:25
To: Tomcat Users List
Subject: Re: Tomcat service crashes unexpectedly, no trace in logs


David,

I have been chasing a similar problem for weeks now with tomcat 5.0.28 
on Linux.  It occurs sporadically, sometimes a couple times a day, 
sometimes after weeks.  I see no errors in the log file and no core 
dumps.  At first I thought it was the JVM crashing but I've tracked it 
down to the JVM shutting down normally somehow, as if somewhere 
System.exit was being called.  I put a security policy in place and 
enabled the security manager to prevent the System.exit call so I 
should find the culprit in my log files the next time its called.

To test if this is what's happening, add a shutdownHook when your app 
starts like this:

public class ExitListener implements ServletContextListener {

 public void contextInitialized(ServletContextEvent event) {
 Runtime.getRuntime().addShutdownHook(new ExitListenerThread());
 System.out.println(ExitListener installed shutdown hook);
 }

 public void contextDestroyed(ServletContextEvent event) {
 System.out.println(ExitListener.contextDestroyed());
 }
}

public class ExitListenerThread extends Thread {
 public void run() {
 System.out.println(ExitListenerThread running!!!);
 System.out.println(current time is:  + new java.util.Date());
 }
}

Hope this helps.

Greg
On Jan 14, 2005, at 2:04 PM, David Vandaele wrote:

 Hi,

 We're experiencing Tomcat crashes during stresstesting of a 
 webapplication.

 Situation: Tomcat runs as a Windows service.  During stresstests the 
 Tomcat-services suddenly ends unexpectedly.  The Windows eventlog 
 logs states something like: ...service ended unexpectedly...  The 
 problem is not easily or consistently reproducable...

 When I look at all the logs of Tomcat and of our webapplication, no 
 mention of an exception or error or crash whatsoever !(?)  (They all 
 just stop abruptly)

 First I thought it was an OutOfMemoryError problem.  I forced an 
 OutOfMemoryError myself by limiting the memory of the JVM of Tomcat 
 severely.  But then I could see loggings of an OutOfMemoryError in the 
 Tomcat stderr-log, which is not what I expected because I didn't 
 expect any loggings of a crash at all...

 The problem only *seems* to occur when the servermachine is completely 
 left alone (not logged in or locked)  Additionally, it usually occurs 
 after between 30-70 minutes or so.  When I keep monitoring the machine 
 while the same tests are running the crash doesn't seem to occur ?!  
 Could it be a power-saving issue, like e.g. with the network-adaptor ? 
  Then I would not expect a crash, but a stacktrace ?

 I tried adding a try-catch(Throwable) around a method where everything 
 starts (the process method of my Struts ActionServlet). I've been 
 trying to reproduce the problem since, but as I mentioned, it's not 
 consistently reproducable...

 I've searched the net trying to find related problems, or a JVM 
 problem of some kind with this version, haven't been successful 
 though...  If it is a problem with bad memory, I would expect to see 
 different behaviour, like more random crashes, not only of the Tomcat 
 service...

 Environment: Tomcat 4.1.29, JDK 1.4.2_03, Windows 2000ProSP4, 
 bi-processor Xeon machine.

 Any help/advice/ideas is really welcome and appreciated !

 Kind regards,

 David

 -
 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: Still having OutOfMemory Problems (Tomcat 4.1.31)

2005-01-17 Thread David Vandaele
Try printing out this:
Runtime.getRuntime().freeMemory():
Runtime.getRuntime().maxMemory();

Check out the API if you want to know the exact meaning of these methods, but 
they are pretty obvious I think.
Now print these somewhere you know you'll get before the OutOfMemError occurs, 
or some place like the service() method or something.

David

-Original Message-
From: David Johnson [mailto:[EMAIL PROTECTED]
Sent: maandag 17 januari 2005 18:52
To: Tomcat Users List
Subject: Still having OutOfMemory Problems (Tomcat 4.1.31)


HI all.

Well I'm still getting my out of memory problem fairly consistently
(again) using Tomcat 4.1.31 with my Struts application.

When I look st the memory usage, it says tomcat is using about 110k of
memory for the VM, but that's just looking at the task manager.

Tomcat is installed as a service using a bat file (follows). Note the
-Xms128M and -Xmx512M options are set...if doesnt seem to matter what
I set these options toeven if I set them to 32m/64m!

How can I tell if tomcat is REALLY using those settings? It doesnt
seem to be

Thanks

-
install.bat:

@SET JAVA_HOME=C:\j2sdk_1_4_0_2
@SET TOMCAT_HOME=C:\Tomcat4.1
@SET TOMCAT_JVM=%JAVA_HOME%\jre\bin\client\jvm.dll
@SET 
TOMCAT_CLASSPATH=%TOMCAT_HOME%\bin\bootstrap.jar;%TOMCAT_HOME%\common\lib\servlet.jar
@SET TOMCAT_ENDORSED=%TOMCAT_HOME%\common\endorsed
@SET TOMCAT_LOG=%TOMCAT_HOME%\logs\stdout.log
@SET TOMCAT_ERR_LOG=%TOMCAT_HOME%\logs\stderr.log

%TOMCAT_HOME%\bin\tomcat.exe -install Apache Tomcat 4.1.31
%TOMCAT_JVM% -Djava.class.path=%TOMCAT_CLASSPATH% -DXms128M -DXmx512M 
-DXX:+PrintTenuringDistribution -DXX:+PrintGCDetails -Xverbosegc
-Djava.endorsed.dirs=%TOMCAT_ENDORSED% -Dcatalina.home=%TOMCAT_HOME%
-start org.apache.catalina.startup.BootstrapService -params start
-stop org.apache.catalina.startup.BootstrapService -params stop -out
%TOMCAT_LOG% -err %TOMCAT_ERR_LOG%

-
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]



Tomcat service crashes unexpectedly, no trace in logs

2005-01-14 Thread David Vandaele
Hi,

We're experiencing Tomcat crashes during stresstesting of a webapplication. 

Situation: Tomcat runs as a Windows service.  During stresstests the 
Tomcat-services suddenly ends unexpectedly.  The Windows eventlog logs states 
something like: ...service ended unexpectedly...  The problem is not easily 
or consistently reproducable...

When I look at all the logs of Tomcat and of our webapplication, no mention of 
an exception or error or crash whatsoever !(?)  (They all just stop abruptly)

First I thought it was an OutOfMemoryError problem.  I forced an 
OutOfMemoryError myself by limiting the memory of the JVM of Tomcat severely.  
But then I could see loggings of an OutOfMemoryError in the Tomcat stderr-log, 
which is not what I expected because I didn't expect any loggings of a crash at 
all...

The problem only *seems* to occur when the servermachine is completely left 
alone (not logged in or locked)  Additionally, it usually occurs after between 
30-70 minutes or so.  When I keep monitoring the machine while the same tests 
are running the crash doesn't seem to occur ?!  Could it be a power-saving 
issue, like e.g. with the network-adaptor ?  Then I would not expect a crash, 
but a stacktrace ?

I tried adding a try-catch(Throwable) around a method where everything starts 
(the process method of my Struts ActionServlet). I've been trying to reproduce 
the problem since, but as I mentioned, it's not consistently reproducable...

I've searched the net trying to find related problems, or a JVM problem of some 
kind with this version, haven't been successful though...  If it is a problem 
with bad memory, I would expect to see different behaviour, like more random 
crashes, not only of the Tomcat service... 

Environment: Tomcat 4.1.29, JDK 1.4.2_03, Windows 2000ProSP4, bi-processor Xeon 
machine.

Any help/advice/ideas is really welcome and appreciated !

Kind regards,

David

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]