Re: Exception in localhost file

2010-01-11 Thread Konstantin Kolinko
2010/1/12 Mohit Anchlia :
> tomcat 6:
>
> I am seeing following exception in localhost file with no stack trace.
> There is no clue as to why this might be happening. How do I get the
> full stack trace to narrow down the problem? We also have our
> application log where our application specific exceptions get logged
> with full stack trace but this is not being logged there.
>
> Jan 11, 2010 4:12:57 PM org.apache.catalina.core.StandardWrapperValve invoke
> SEVERE: Servlet.service() for servlet SwchServlet threw exception
> java.lang.ArrayIndexOutOfBoundsException
>

What is your exact version of Tomcat, and what is your version of Java?
Is your conf\logging.properties file different from the default one?



Best regards,
Konstantin Kolinko

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Running Tomcat 6 as a service

2010-01-11 Thread Russell Collins
I am using JRockit as my java runtime.  When I manually start Tomcat, I have no 
problems with it.  However, when I try to run Tomcat as a service with JRockit 
as my java runtime, I get an error that says that it cannot start the service.  
I looked in the service.bat file and I think that I may have found where this 
error is happening.  The following lines are in the batch file


rem Set the server jvm from JAVA_HOME
set PR_JVM=%JAVA_HOME%\jre\bin\server\jvm.dll
if exist "%PR_JVM%" goto foundJvm
rem Set the client jvm from JAVA_HOME
set PR_JVM=%JAVA_HOME%\jre\bin\client\jvm.dll
if exist "%PR_JVM%" goto foundJvm


JRockit does not have these entries in their java runtime directories.  These 
are specific to Sun's implementation.  The interesting thing is that I also run 
an Apache Geronimo serice using JRockit as the java runtime and it runs great.  
Can these lines be omitted?  Are they crucial for Apache Tomcat to run as a 
service without issue?


Russell Collins
Sr. Software Engineer
McLane Advanced Technology
254.771.6419



"Do or do not, there is no try." - Yoda



CONFIDENTIALITY NOTICE: The information contained in this electronic mail 
(email) transmission (including attachments), is intended by MCLANE ADVANCED 
TECHNOLOGIES for the use of the named individual or entity to which it is 
addressed and may contain information that is privileged, confidential and/or 
protected as a trade secret. It is not intended for transmission to, or receipt 
by, any individual or entity other than the named addressee(s). If you have 
received this email in error, please delete it (including attachments) and any 
copies thereof without printing, copying or forwarding it, and notify the 
sender of the error by email reply immediately.


Tips on tracking down memory leaks

2010-01-11 Thread Greg McCane
Hi Everyone,

I am running tomcat 5.5 on Debian Linux (uname says Linux 2.6.26-2-amd64, 
/etc/debian_version says 5.0.2). The JVM version is 1.5.0_14-b03.

We have 9 servlets running.

The tomcat process itself is managed by monit.

We see tomcat memory usage growing over time and have set monit to 
automatically restart it (using the /etc/init.d/tomcat5.5 startup script) when 
memory usage reaches 2.8 GB. It takes about 20 hours to get to this point. This 
is an attempt to avoid a tomcat crash/hang resulting in an outage for our 
users. The memory growth appears to be in large chunks rather than slow, steady 
growth.

We have turned on incremental garbage collection with the following options:

"-XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode 
-XX:+CMSIncrementalPacing -XX:CMSIncrementalDutyCycleMin=0 
-XX:+CMSIncrementalDutyCycle=10 -XX:-TraceClassUnloading
-XX:+CMSPermGenSweepingEnabled -XX:+CMSClassUnloadingEnabled"

The JVM heap size is set with: "-Xmx3072M -Xms1024M "

We have checked our code using pmd and have profiled it using TPT and Eclipse 
in our development environment. We have made improvements as a result of the 
findings from these tools, but we are still having problems.

Any suggestions for next steps to help us get to the root cause of this problem?

Thanks,
Greg


  __
Looking for the perfect gift? Give the gift of Flickr! 

http://www.flickr.com/gift/

Exception in localhost file

2010-01-11 Thread Mohit Anchlia
tomcat 6:

I am seeing following exception in localhost file with no stack trace.
There is no clue as to why this might be happening. How do I get the
full stack trace to narrow down the problem? We also have our
application log where our application specific exceptions get logged
with full stack trace but this is not being logged there.

Jan 11, 2010 4:12:57 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet SwchServlet threw exception
java.lang.ArrayIndexOutOfBoundsException

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: JVM goes away

2010-01-11 Thread Carl
Aha, for some reason, I thought perm gen was included in the general heap so 
the maximum for the two combined was constrained by the 2400m I had defined 
for the heap.  Somewhere around 2:00AM (I am US east coast), I can restart 
the server with the new settings.


I have taken several heap dumps (using Visual JVM) and nothing looked odd. 
Also, I can see (from Visual JVM) that the GC runs reasonably frequently 
when the heap grows (from users working) but the total heap is generally 
under 1GB.  I wonder if the sneaky little bugger, under load, just pushes to 
OOM and I am running so close to the edge that I don't see it.  Odd though, 
I have forced OOM issues in the past and they always showed up in 
catalina.out.


Thanks for your thoughts and help.

Carl

- Original Message - 
From: "Pid" 

To: 
Sent: Monday, January 11, 2010 8:07 PM
Subject: Re: JVM goes away



On 11/01/2010 23:06, Peter Crowther wrote:

2010/1/11 Carl:
This is a new server, a Dell T110 with a Xeon 3440 processor and 4GB 
memory.  I have turned off both the turbo mode and hyperthreading.


The environment:

64 bit Slackware Linux

java version "1.6.0_17"
Java(TM) SE Runtime Environment (build 1.6.0_17-b04)
Java HotSpot(TM) 64-Bit Server VM (build 14.3-b01, mixed mode)

Tomcat: apache-tomcat-6.0.20

JAVA_OPTS="-Xms2400m -Xmx2400m -XX:PermSize=512m -XX:MaxPermSize=512m"

I have watched observed the memory usage and general performance with 
Java VisualVM and have seen nothing strange.  GC seems to be performing 
well and the memory rarely gets anywhere near the max.


The server runs well, idling along at 2-5% load, serving jsp's, etc. at 
a reasonable speed.  Without warning and with no tracks in any log 
(Tomcat or system) or to the console, the JVM will just go away, 
disappear.  Sometimes, the system will run for a week, sometimes for 
only several hours.  Initially, I thought the problem was the turbo or 
hyperthreading but, no, the problem persists.


When the JVM goes away, the memory that it held is still being held (as 
seen from top) but it is nowhere near the machine physical memory.


The application has been running on an older server (Dell 600SC, 32 bit 
Slackware, 2GB memory) for several years and, while the application will 
throw exceptions now and then, it never crashed the JVM.  This leads me 
to believe the problem has something to do with the 64 bit JVM but, with 
errors, I can't be certain and don't know what I can do about it except 
go back to 32 bit.


I plan to reinstall Java tonight but, it would seem if the JVM were 
corrupted, it simply would not run.


Any ideas are welcome.


I'm with Andy: the Linux OOM killer would show those symptoms.  With
those settings, you're not leaving a lot of memory for the OS.  How
much swap do you have, and does the same thing happen if you reduce
the Java heap and permgen space?

- Peter


Despite later posts, I'm leaning towards agreeing with the above, based on 
the information provided.


N.B. Maximum heap size does not equal the maximum memory a JVM can/will 
use.


The Perm generation is in addition to the heap so you're effectively 
saying that the memory you want to use is 2400 + 512 (+ other stuff 
falling into the non-heap category).


So you may be using more than 3Gb; jmap -heap  will provide more 
information, you could regularly dump the output to file to see what's 
happening with the JVM.


http://java.sun.com/javase/6/docs/technotes/guides/management/jconsole.html

(Confession: I'm not sure I've got my head round it yet)



An OOM should leave a trace somewhere on your system, it might be a single 
log entry saying that a given process id has been terminated.


Google for specific info for your OS.


p




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org





-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: JVM goes away

2010-01-11 Thread Pid

On 11/01/2010 23:06, Peter Crowther wrote:

2010/1/11 Carl:

This is a new server, a Dell T110 with a Xeon 3440 processor and 4GB memory.  I 
have turned off both the turbo mode and hyperthreading.

The environment:

64 bit Slackware Linux

java version "1.6.0_17"
Java(TM) SE Runtime Environment (build 1.6.0_17-b04)
Java HotSpot(TM) 64-Bit Server VM (build 14.3-b01, mixed mode)

Tomcat: apache-tomcat-6.0.20

JAVA_OPTS="-Xms2400m -Xmx2400m -XX:PermSize=512m -XX:MaxPermSize=512m"

I have watched observed the memory usage and general performance with Java 
VisualVM and have seen nothing strange.  GC seems to be performing well and the 
memory rarely gets anywhere near the max.

The server runs well, idling along at 2-5% load, serving jsp's, etc. at a 
reasonable speed.  Without warning and with no tracks in any log (Tomcat or 
system) or to the console, the JVM will just go away, disappear.  Sometimes, 
the system will run for a week, sometimes for only several hours.  Initially, I 
thought the problem was the turbo or hyperthreading but, no, the problem 
persists.

When the JVM goes away, the memory that it held is still being held (as seen 
from top) but it is nowhere near the machine physical memory.

The application has been running on an older server (Dell 600SC, 32 bit 
Slackware, 2GB memory) for several years and, while the application will throw 
exceptions now and then, it never crashed the JVM.  This leads me to believe 
the problem has something to do with the 64 bit JVM but, with errors, I can't 
be certain and don't know what I can do about it except go back to 32 bit.

I plan to reinstall Java tonight but, it would seem if the JVM were corrupted, 
it simply would not run.

Any ideas are welcome.


I'm with Andy: the Linux OOM killer would show those symptoms.  With
those settings, you're not leaving a lot of memory for the OS.  How
much swap do you have, and does the same thing happen if you reduce
the Java heap and permgen space?

- Peter


Despite later posts, I'm leaning towards agreeing with the above, based 
on the information provided.


N.B. Maximum heap size does not equal the maximum memory a JVM can/will use.

The Perm generation is in addition to the heap so you're effectively 
saying that the memory you want to use is 2400 + 512 (+ other stuff 
falling into the non-heap category).


So you may be using more than 3Gb; jmap -heap  will provide more 
information, you could regularly dump the output to file to see what's 
happening with the JVM.


http://java.sun.com/javase/6/docs/technotes/guides/management/jconsole.html

(Confession: I'm not sure I've got my head round it yet)



An OOM should leave a trace somewhere on your system, it might be a 
single log entry saying that a given process id has been terminated.


Google for specific info for your OS.


p




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: JVM goes away

2010-01-11 Thread Carl

Konstantin,

Yes, it was started using startup.sh in tomcat/bin and used the same ports 
(8080, 8443, 443) as the tomcat that died.  The fact that the OS did not 
recover the memory implied to me (could be wrong, even very wrong) that the 
JVM just died.  However, as you point out, how did the ports get freed up. 
So, now it looks more like I am somehow killing Tomcat because that is the 
only way those ports could be freed.  Shouldn't I see some tracks in one of 
Tomcat's logs then?


Thanks,

Carl

- Original Message - 
From: "Konstantin Kolinko" 

To: "Tomcat Users List" 
Sent: Monday, January 11, 2010 7:31 PM
Subject: Re: JVM goes away


2010/1/12 Carl :

Peter and Andy,

Thanks for your quick responses.

Memory: Physical - $GB
Used - 2.4GB to 3.0 GB (according to top... have never seen it
above 3GB)
Swap - 19GB, none ever used (or, at least I have never seen
any used.)

The above are all from top.

The 2.4GB is after the JVM just crashed (after running less than an hour
after having run for five days with nary a blip) and I just restarted 
Tomcat

(customers are running right now) so it is a little higher than normal
because it has perhaps .5GB+ unrecovered from the point at which the JVM
crashed.



You started the new Tomcat instance using the same port numbers that
were used by the old one?

If so, the old one has really died, but how come that the memory was not 
freed?




I checked dmsg but saw nothing that looked out of the ordinary.


dmesg they say

In OOM killer scenario it can be sometimes caused by some maintenance
task scheduled with cron. But an OOM killer which does not free memory
would be very much useless.



Best regards,
Konstantin Kolinko

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: JVM goes away

2010-01-11 Thread Konstantin Kolinko
2010/1/12 Carl :
> Peter and Andy,
>
> Thanks for your quick responses.
>
> Memory:  Physical - $GB
>               Used - 2.4GB to 3.0 GB (according to top... have never seen it
> above 3GB)
>               Swap - 19GB, none ever used (or, at least I have never seen
> any used.)
>
> The above are all from top.
>
> The 2.4GB is after the JVM just crashed (after running less than an hour
> after having run for five days with nary a blip) and I just restarted Tomcat
> (customers are running right now) so it is a little higher than normal
> because it has perhaps .5GB+ unrecovered from the point at which the JVM
> crashed.
>

You started the new Tomcat instance using the same port numbers that
were used by the old one?

If so, the old one has really died, but how come that the memory was not freed?


> I checked dmsg but saw nothing that looked out of the ordinary.

dmesg they say

In OOM killer scenario it can be sometimes caused by some maintenance
task scheduled with cron. But an OOM killer which does not free memory
would be very much useless.



Best regards,
Konstantin Kolinko

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: JVM goes away

2010-01-11 Thread Carl

Andy,

Yes, that is 4GB... just a little stressed.

I did a 'find' for all 'hs_err*.pid' files and turned up nothing, no files 
were found.


I am using catalina.sh to start Tomcat and I had always assumed that the 
java JVM was started in that process somewhere.  I apologize for my 
ignorance here but I don't see any java processes other than Tomcat and 
Visual JVM (using ps -ef.)  I do have a little java listener also running 
that serves some data to client applets.  Neither the little listener nor 
Visual JVM went down when Tomcat stopped.


Tomcat is in /usr/local/tomcat (bin, conf, etc.)  Java is in usr/local/java. 
Is the 'cwd of the java process' the directory where the application 
(Tomcat) is running or the bin directory of java?  (I don't see anything in 
any of those areas that looks odd or informative.)


How can I tell if the JVM is or is not running as a daemon?

TIA,

Carl


- Original Message - 
From: "Andy Wang" 

To: 
Sent: Monday, January 11, 2010 6:42 PM
Subject: Re: JVM goes away



I assume $GB means 4GB :)
With that kind of memory use it doesn't sound entirely like the OOM
killer.  Have you looked around the filesystem for hs_err[pid].pid
files?  This usually is written to the cwd of the java process.  That
might give you ideas if it's a native crash.  If so, it'll have the java
stack, and other native information that might shed some light.

Otherwise, if the Tomcat JVM isn't running as a daemon, is it nohup'ed?

Andy

On 01/11/2010 05:33 PM, Carl wrote:

Peter and Andy,

Thanks for your quick responses.

Memory:  Physical - $GB
   Used - 2.4GB to 3.0 GB (according to top... have never
seen it above 3GB)
   Swap - 19GB, none ever used (or, at least I have never
seen any used.)

The above are all from top.

The 2.4GB is after the JVM just crashed (after running less than an
hour after having run for five days with nary a blip) and I just
restarted Tomcat (customers are running right now) so it is a little
higher than normal because it has perhaps .5GB+ unrecovered from the
point at which the JVM crashed.

I checked dmsg but saw nothing that looked out of the ordinary.

I will cut back on the heap and permgen tonight (gonna be a long one.)

Any ideas are welcome.

Thanks,

Carl


- Original Message - From: "Peter Crowther"

To: "Tomcat Users List" 
Sent: Monday, January 11, 2010 6:06 PM
Subject: Re: JVM goes away


2010/1/11 Carl :

This is a new server, a Dell T110 with a Xeon 3440 processor and 4GB
memory. I have turned off both the turbo mode and hyperthreading.

The environment:

64 bit Slackware Linux

java version "1.6.0_17"
Java(TM) SE Runtime Environment (build 1.6.0_17-b04)
Java HotSpot(TM) 64-Bit Server VM (build 14.3-b01, mixed mode)

Tomcat: apache-tomcat-6.0.20

JAVA_OPTS="-Xms2400m -Xmx2400m -XX:PermSize=512m -XX:MaxPermSize=512m"

I have watched observed the memory usage and general performance with
Java VisualVM and have seen nothing strange. GC seems to be
performing well and the memory rarely gets anywhere near the max.

The server runs well, idling along at 2-5% load, serving jsp's, etc.
at a reasonable speed. Without warning and with no tracks in any log
(Tomcat or system) or to the console, the JVM will just go away,
disappear. Sometimes, the system will run for a week, sometimes for
only several hours. Initially, I thought the problem was the turbo or
hyperthreading but, no, the problem persists.

When the JVM goes away, the memory that it held is still being held
(as seen from top) but it is nowhere near the machine physical memory.

The application has been running on an older server (Dell 600SC, 32
bit Slackware, 2GB memory) for several years and, while the
application will throw exceptions now and then, it never crashed the
JVM. This leads me to believe the problem has something to do with
the 64 bit JVM but, with errors, I can't be certain and don't know
what I can do about it except go back to 32 bit.

I plan to reinstall Java tonight but, it would seem if the JVM were
corrupted, it simply would not run.

Any ideas are welcome.


I'm with Andy: the Linux OOM killer would show those symptoms.  With
those settings, you're not leaving a lot of memory for the OS.  How
much swap do you have, and does the same thing happen if you reduce
the Java heap and permgen space?

- Peter

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org





-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org





--

Re: JVM goes away

2010-01-11 Thread Andy Wang
I assume $GB means 4GB :)
With that kind of memory use it doesn't sound entirely like the OOM
killer.  Have you looked around the filesystem for hs_err[pid].pid
files?  This usually is written to the cwd of the java process.  That
might give you ideas if it's a native crash.  If so, it'll have the java
stack, and other native information that might shed some light.

Otherwise, if the Tomcat JVM isn't running as a daemon, is it nohup'ed?

Andy

On 01/11/2010 05:33 PM, Carl wrote:
> Peter and Andy,
>
> Thanks for your quick responses.
>
> Memory:  Physical - $GB
>Used - 2.4GB to 3.0 GB (according to top... have never
> seen it above 3GB)
>Swap - 19GB, none ever used (or, at least I have never
> seen any used.)
>
> The above are all from top.
>
> The 2.4GB is after the JVM just crashed (after running less than an
> hour after having run for five days with nary a blip) and I just
> restarted Tomcat (customers are running right now) so it is a little
> higher than normal because it has perhaps .5GB+ unrecovered from the
> point at which the JVM crashed.
>
> I checked dmsg but saw nothing that looked out of the ordinary.
>
> I will cut back on the heap and permgen tonight (gonna be a long one.)
>
> Any ideas are welcome.
>
> Thanks,
>
> Carl
>
>
> - Original Message - From: "Peter Crowther"
> 
> To: "Tomcat Users List" 
> Sent: Monday, January 11, 2010 6:06 PM
> Subject: Re: JVM goes away
>
>
> 2010/1/11 Carl :
>> This is a new server, a Dell T110 with a Xeon 3440 processor and 4GB
>> memory. I have turned off both the turbo mode and hyperthreading.
>>
>> The environment:
>>
>> 64 bit Slackware Linux
>>
>> java version "1.6.0_17"
>> Java(TM) SE Runtime Environment (build 1.6.0_17-b04)
>> Java HotSpot(TM) 64-Bit Server VM (build 14.3-b01, mixed mode)
>>
>> Tomcat: apache-tomcat-6.0.20
>>
>> JAVA_OPTS="-Xms2400m -Xmx2400m -XX:PermSize=512m -XX:MaxPermSize=512m"
>>
>> I have watched observed the memory usage and general performance with
>> Java VisualVM and have seen nothing strange. GC seems to be
>> performing well and the memory rarely gets anywhere near the max.
>>
>> The server runs well, idling along at 2-5% load, serving jsp's, etc.
>> at a reasonable speed. Without warning and with no tracks in any log
>> (Tomcat or system) or to the console, the JVM will just go away,
>> disappear. Sometimes, the system will run for a week, sometimes for
>> only several hours. Initially, I thought the problem was the turbo or
>> hyperthreading but, no, the problem persists.
>>
>> When the JVM goes away, the memory that it held is still being held
>> (as seen from top) but it is nowhere near the machine physical memory.
>>
>> The application has been running on an older server (Dell 600SC, 32
>> bit Slackware, 2GB memory) for several years and, while the
>> application will throw exceptions now and then, it never crashed the
>> JVM. This leads me to believe the problem has something to do with
>> the 64 bit JVM but, with errors, I can't be certain and don't know
>> what I can do about it except go back to 32 bit.
>>
>> I plan to reinstall Java tonight but, it would seem if the JVM were
>> corrupted, it simply would not run.
>>
>> Any ideas are welcome.
>
> I'm with Andy: the Linux OOM killer would show those symptoms.  With
> those settings, you're not leaving a lot of memory for the OS.  How
> much swap do you have, and does the same thing happen if you reduce
> the Java heap and permgen space?
>
> - Peter
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: JVM goes away

2010-01-11 Thread Carl

Peter and Andy,

Thanks for your quick responses.

Memory:  Physical - $GB
   Used - 2.4GB to 3.0 GB (according to top... have never seen 
it above 3GB)
   Swap - 19GB, none ever used (or, at least I have never seen 
any used.)


The above are all from top.

The 2.4GB is after the JVM just crashed (after running less than an hour 
after having run for five days with nary a blip) and I just restarted Tomcat 
(customers are running right now) so it is a little higher than normal 
because it has perhaps .5GB+ unrecovered from the point at which the JVM 
crashed.


I checked dmsg but saw nothing that looked out of the ordinary.

I will cut back on the heap and permgen tonight (gonna be a long one.)

Any ideas are welcome.

Thanks,

Carl


- Original Message - 
From: "Peter Crowther" 

To: "Tomcat Users List" 
Sent: Monday, January 11, 2010 6:06 PM
Subject: Re: JVM goes away


2010/1/11 Carl :
This is a new server, a Dell T110 with a Xeon 3440 processor and 4GB 
memory. I have turned off both the turbo mode and hyperthreading.


The environment:

64 bit Slackware Linux

java version "1.6.0_17"
Java(TM) SE Runtime Environment (build 1.6.0_17-b04)
Java HotSpot(TM) 64-Bit Server VM (build 14.3-b01, mixed mode)

Tomcat: apache-tomcat-6.0.20

JAVA_OPTS="-Xms2400m -Xmx2400m -XX:PermSize=512m -XX:MaxPermSize=512m"

I have watched observed the memory usage and general performance with Java 
VisualVM and have seen nothing strange. GC seems to be performing well and 
the memory rarely gets anywhere near the max.


The server runs well, idling along at 2-5% load, serving jsp's, etc. at a 
reasonable speed. Without warning and with no tracks in any log (Tomcat or 
system) or to the console, the JVM will just go away, disappear. 
Sometimes, the system will run for a week, sometimes for only several 
hours. Initially, I thought the problem was the turbo or hyperthreading 
but, no, the problem persists.


When the JVM goes away, the memory that it held is still being held (as 
seen from top) but it is nowhere near the machine physical memory.


The application has been running on an older server (Dell 600SC, 32 bit 
Slackware, 2GB memory) for several years and, while the application will 
throw exceptions now and then, it never crashed the JVM. This leads me to 
believe the problem has something to do with the 64 bit JVM but, with 
errors, I can't be certain and don't know what I can do about it except go 
back to 32 bit.


I plan to reinstall Java tonight but, it would seem if the JVM were 
corrupted, it simply would not run.


Any ideas are welcome.


I'm with Andy: the Linux OOM killer would show those symptoms.  With
those settings, you're not leaving a lot of memory for the OS.  How
much swap do you have, and does the same thing happen if you reduce
the Java heap and permgen space?

- Peter

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: JVM goes away

2010-01-11 Thread Peter Crowther
2010/1/11 Carl :
> This is a new server, a Dell T110 with a Xeon 3440 processor and 4GB memory.  
> I have turned off both the turbo mode and hyperthreading.
>
> The environment:
>
> 64 bit Slackware Linux
>
> java version "1.6.0_17"
> Java(TM) SE Runtime Environment (build 1.6.0_17-b04)
> Java HotSpot(TM) 64-Bit Server VM (build 14.3-b01, mixed mode)
>
> Tomcat: apache-tomcat-6.0.20
>
> JAVA_OPTS="-Xms2400m -Xmx2400m -XX:PermSize=512m -XX:MaxPermSize=512m"
>
> I have watched observed the memory usage and general performance with Java 
> VisualVM and have seen nothing strange.  GC seems to be performing well and 
> the memory rarely gets anywhere near the max.
>
> The server runs well, idling along at 2-5% load, serving jsp's, etc. at a 
> reasonable speed.  Without warning and with no tracks in any log (Tomcat or 
> system) or to the console, the JVM will just go away, disappear.  Sometimes, 
> the system will run for a week, sometimes for only several hours.  Initially, 
> I thought the problem was the turbo or hyperthreading but, no, the problem 
> persists.
>
> When the JVM goes away, the memory that it held is still being held (as seen 
> from top) but it is nowhere near the machine physical memory.
>
> The application has been running on an older server (Dell 600SC, 32 bit 
> Slackware, 2GB memory) for several years and, while the application will 
> throw exceptions now and then, it never crashed the JVM.  This leads me to 
> believe the problem has something to do with the 64 bit JVM but, with errors, 
> I can't be certain and don't know what I can do about it except go back to 32 
> bit.
>
> I plan to reinstall Java tonight but, it would seem if the JVM were 
> corrupted, it simply would not run.
>
> Any ideas are welcome.

I'm with Andy: the Linux OOM killer would show those symptoms.  With
those settings, you're not leaving a lot of memory for the OS.  How
much swap do you have, and does the same thing happen if you reduce
the Java heap and permgen space?

- Peter

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: JVM goes away

2010-01-11 Thread Andy Wang
dmesg
check if the linux out of memory kill struck you :)

Andy

On 01/11/2010 04:37 PM, Carl wrote:
> This is a new server, a Dell T110 with a Xeon 3440 processor and 4GB memory.  
> I have turned off both the turbo mode and hyperthreading.
>
> The environment:
>
> 64 bit Slackware Linux
>
> java version "1.6.0_17"
> Java(TM) SE Runtime Environment (build 1.6.0_17-b04)
> Java HotSpot(TM) 64-Bit Server VM (build 14.3-b01, mixed mode)
>
> Tomcat: apache-tomcat-6.0.20
>
> JAVA_OPTS="-Xms2400m -Xmx2400m -XX:PermSize=512m -XX:MaxPermSize=512m"
>
> I have watched observed the memory usage and general performance with Java 
> VisualVM and have seen nothing strange.  GC seems to be performing well and 
> the memory rarely gets anywhere near the max.
>
> The server runs well, idling along at 2-5% load, serving jsp's, etc. at a 
> reasonable speed.  Without warning and with no tracks in any log (Tomcat or 
> system) or to the console, the JVM will just go away, disappear.  Sometimes, 
> the system will run for a week, sometimes for only several hours.  Initially, 
> I thought the problem was the turbo or hyperthreading but, no, the problem 
> persists.
>
> When the JVM goes away, the memory that it held is still being held (as seen 
> from top) but it is nowhere near the machine physical memory.
>
> The application has been running on an older server (Dell 600SC, 32 bit 
> Slackware, 2GB memory) for several years and, while the application will 
> throw exceptions now and then, it never crashed the JVM.  This leads me to 
> believe the problem has something to do with the 64 bit JVM but, with errors, 
> I can't be certain and don't know what I can do about it except go back to 32 
> bit.
>
> I plan to reinstall Java tonight but, it would seem if the JVM were 
> corrupted, it simply would not run.
>
> Any ideas are welcome.
>
> TIA,
>
> Carl
>
>
>   


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



JVM goes away

2010-01-11 Thread Carl
This is a new server, a Dell T110 with a Xeon 3440 processor and 4GB memory.  I 
have turned off both the turbo mode and hyperthreading.

The environment:

64 bit Slackware Linux

java version "1.6.0_17"
Java(TM) SE Runtime Environment (build 1.6.0_17-b04)
Java HotSpot(TM) 64-Bit Server VM (build 14.3-b01, mixed mode)

Tomcat: apache-tomcat-6.0.20

JAVA_OPTS="-Xms2400m -Xmx2400m -XX:PermSize=512m -XX:MaxPermSize=512m"

I have watched observed the memory usage and general performance with Java 
VisualVM and have seen nothing strange.  GC seems to be performing well and the 
memory rarely gets anywhere near the max.

The server runs well, idling along at 2-5% load, serving jsp's, etc. at a 
reasonable speed.  Without warning and with no tracks in any log (Tomcat or 
system) or to the console, the JVM will just go away, disappear.  Sometimes, 
the system will run for a week, sometimes for only several hours.  Initially, I 
thought the problem was the turbo or hyperthreading but, no, the problem 
persists.

When the JVM goes away, the memory that it held is still being held (as seen 
from top) but it is nowhere near the machine physical memory.

The application has been running on an older server (Dell 600SC, 32 bit 
Slackware, 2GB memory) for several years and, while the application will throw 
exceptions now and then, it never crashed the JVM.  This leads me to believe 
the problem has something to do with the 64 bit JVM but, with errors, I can't 
be certain and don't know what I can do about it except go back to 32 bit.

I plan to reinstall Java tonight but, it would seem if the JVM were corrupted, 
it simply would not run.

Any ideas are welcome.

TIA,

Carl



RE: Tomcat memory settings

2010-01-11 Thread Caldarale, Charles R
> From: Leo Donahue - PLANDEVX [mailto:leodona...@mail.maricopa.gov]
> Subject: Tomcat memory settings
> 
> I've read many previous posts and online articles about increasing the
> memory settings for Tomcat.  As it stands, I've modified the
> catalina.bat file and set the CATALINA_OPTS variable from what was
> nothing to the following:

That does nothing for the service, which does not use the .bat scripts.  Use 
the bin/tomcat6w.exe program to manipulate the heap settings, which are on the 
Java tab of the GUI.  I'd recommend setting min and max heap sizes to the same 
value to avoid thrashing.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat memory settings

2010-01-11 Thread Paul Campbell

http://www.theserverside.com/news/thread.tss?thread_id=48390


http://wiki.apache.org/tomcat/FAQ/Memory

Try googling

On 01/11/2010 11:29 AM, Leo Donahue - PLANDEVX wrote:

Tomcat 6.0.20 zip (used service command to run as windows service)
Window 2003 Server 2.0GB RAM (1.3GB available)

My problem:

org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet "servlet name" threw exception
java.lang.OutOfMemoryError: Java heap space

I've read many previous posts and online articles about increasing the memory 
settings for Tomcat.  As it stands, I've modified the catalina.bat file and set 
the CATALINA_OPTS variable from what was nothing to the following:

:doStop
shift
set ACTION=stop
set CATALINA_OPTS=-Xms256m -Xmx512m
goto execCmd


I have restarted Tomcat.

1.  Was that the right way to increase the memory for Tomcat 6.0.20?
2.  Do I monitor the log files to see if this setting was enough?  I realize 
there could be many other things related to heap space errors.


Leo Donahue

   



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Tomcat memory settings

2010-01-11 Thread Leo Donahue - PLANDEVX
Tomcat 6.0.20 zip (used service command to run as windows service)
Window 2003 Server 2.0GB RAM (1.3GB available)

My problem:

org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet "servlet name" threw exception
java.lang.OutOfMemoryError: Java heap space

I've read many previous posts and online articles about increasing the memory 
settings for Tomcat.  As it stands, I've modified the catalina.bat file and set 
the CATALINA_OPTS variable from what was nothing to the following:

:doStop
shift
set ACTION=stop
set CATALINA_OPTS=-Xms256m -Xmx512m
goto execCmd


I have restarted Tomcat.

1.  Was that the right way to increase the memory for Tomcat 6.0.20?
2.  Do I monitor the log files to see if this setting was enough?  I realize 
there could be many other things related to heap space errors.


Leo Donahue


mod_jk: plus-character causes %-encoding problems

2010-01-11 Thread Tero Karttunen
SHORT SUMMARY:
===
When Apache HTTPD is used for both URL manipulation (request
redirecting) and load-balancing with mod_jk, the plus-characters seem
to behave strangely during character re-encoding. Is this a bug or a
feature, and how should the system be set up to ensure correct
operation?

MY SYSTEM SET-UP:
=
My application is running on two separate Tomcat 6.0.20 instances.
Apache HTTPD 2.2.14 (with mod_jk 1.2.28) acts as facade and load
balancer for my application. Apache HTTPD performs two functions: it
performs URL redirection from short URLs /sites/* to longer actual
URLs /contextroot/subcontext/sites/, and it forwards the requests to
the actual URLs to the loadbalancer, which in turn utilizes the Tomcat
instances via AJP connectors. The redirect requests are being served
by mod_alias, not mod_rewrite.

Here are the most relevant lines in httpd.conf:

LogFormat "%a %t \"%r\" %X%>s
%{JK_LB_LAST_NAME}n(%{JK_LB_FIRST_NAME}n) %b %D" ts
CustomLog "|bin/rotatelogs logs/access-%Y%m%d-%H%M%S.log 5M" ts
JkMount /contextroot/* loadbalancer
AllowEncodedSlashes On
RedirectMatch ^/sites(.*)$ /contextroot/subcontext/sites$1

Notice that I have not set any explicit forwarding options, which in
this mod_jk version implies +ForwardURIProxy.

To begin with: Calling Tomcat HTTP connectors directly with
http://localhost:8082/contextroot/subcontext/sites/one%2Bone%3Cthree
work correctly and application decodes the URL to
"sites/one+onehttp://localhost/sites/one%2Bone%3Cthree with
Internet Explorer browser.
Apache HTTPD access log:
131.177.146.160 [11/Jan/2010:12:42:49 +0200] "GET
/sites/one%2Bone%3Cthree HTTP/1.1" +302 -(-) 263 0
131.177.146.160 [11/Jan/2010:12:42:49 +0200] "GET
/contextroot/subcontext/sites/one+one%3cthree HTTP/1.1" +200
worker2(worker2) 399 0
Apache Tomcat access log ("standard" access valve):
131.177.146.160 - - [11/Jan/2010:12:44:59 +0200] "GET
/contextroot/subcontext/sites/one+one%3Cthree HTTP/1.1" 200 399
What my application actually sees after decoding the URL: sites/one onehttp://localhost/contextroot/subcontext/sites/one%2Bone%3Cfour,
Apache HTTPD access log now shows:
131.177.146.160 [11/Jan/2010:12:53:37 +0200] "GET
/ts_core_virtual_repository/TeamCenterEmulator/sites/one%2Bone%3Cfour
HTTP/1.1" +200 worker1(worker1) 399 15625
but Tomcat access log still shows:
131.177.146.160 - - [11/Jan/2010:12:53:34 +0200] "GET
/ts_core_virtual_repository/TeamCenterEmulator/sites/one+one%3Cfour
HTTP/1.1" 200 399
and my application sees after decoding the URL: sites/one onehttp://localhost/sites/one%2Bone%3Cfive with
Internet Explorer.
Apache HTTPD access log:
131.177.146.160 [11/Jan/2010:12:58:04 +0200] "GET
/sites/one%2Bone%3Cfive HTTP/1.1" +302 -(-) 278 0
131.177.146.160 [11/Jan/2010:12:58:04 +0200] "GET
/contextroot/subcontext/sites/one+one%3cfive HTTP/1.1" +200
worker1(worker1)
Apache Tomcat access log:
131.177.146.160 - - [11/Jan/2010:12:58:04 +0200] "GET
/ts_core_virtual_repository/TeamCenterEmulator/sites/one+one%3cfive
HTTP/1.1" 200 399
What my application actually sees after decoding: sites/one onehttp://localhost/contextroot/subcontext/sites/one%2Bone%3Csix. This
time,
Apache HTTPD access log shows:
131.177.146.160 [11/Jan/2010:13:00:20 +0200] "GET
/contextroot/subcontext/sites/one%2Bone%3csix HTTP/1.1" +200
worker1(worker1) 399 15625
and Tomcat access log shows:
131.177.146.160 - - [11/Jan/2010:13:00:18 +0200] "GET
/contextroot/subcontext/sites/one%2Bone%3csix HTTP/1.1" 200 399
This time my application sees the intended request after decoding the
URL: sites/one+onehttp://localhost/sites/one%2Bone%3Cthree gives the same same results
as http://localhost:8082/contextroot/subcontext/sites/one%2Bone%3Cthree?

Best Regards,
Tero Karttunen

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Configuring tomcat to release the webapp jar file handles

2010-01-11 Thread Vijay
Thanks for the pointers Chris.
I did some more research to isolate the cause of the issue (my web
application, java or tomcat).

I used a 5.5.28 tomcat installation and ensured that there is no webapp
running within tomcat.
Then I pointed JAVA_HOME to java 1.5 and 1.6 and looked at the file
descriptors opened by the tomcat process.

with tomcat 5.5.28 and java 1.5, there were _no_  jar files in the list of
file descriptors consumed by tomcat process.

with tomcat 5.5.28 and java 1.6, there were around 35 jar files in the list
of file descriptors consumed by tomcat process. I am attaching the contents
of /proc//fd.

Form this observation, the problem is due to the JDK 1.6 classes (or an
incorrect usage by Tomcat of a particular set of classes).

Any pointers to a JDK bug that could be related to this..

Thanks
Vijay

On Wed, Jan 6, 2010 at 7:29 PM, Christopher Schultz <
ch...@christopherschultz.net> wrote:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> Vijay,
>
> On 1/6/2010 1:12 AM, Vijay wrote:
> > I have a webapp that has 300 jar files bundled in WEB-INF/lib. Most
> of
> > the classes in these jar files need to be loaded during the startup of
> the
> > webapp. Does tomcat release the jar file handles once the class loader is
> > done loading the classes? It does not seem to be the case.
> > Ideally, tomcat should close the jar file handles that the webapp no
> longer
> > needs.
>
> I haven't looked at the code, but it would seem that the
> WebappClassLoader shouldn't need file handles to remain open to do it's
> up-to-date checking of .jar and .class files.
>
> WebappClassLoader /does/ contain a JarFile[] member, which may keep file
> handles open. I haven't looked at the code -- only the Javadoc.
>
> > Is there a way to configure tomcat to have an agressive policy to close
> > unused file handles?
>
> None that I know of: patches are always welcome.
>
> - -chris
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1.4.10 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>
> iEYEARECAAYFAktEly8ACgkQ9CaO5/Lv0PAKrgCgwCSa9Xy5MVlpYBy+Gn3AZXeE
> jukAn3DpombmSP3FXZ8EPTobtgDe09b8
> =GKts
> -END PGP SIGNATURE-
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


-- 

A. Vijayaraghavan
Software Engineer
Direct: +91 80 4020 3258
Mob   : +91 98861 70810
Informatica Business Solutions PVT LTD
"The Data Integration Company" (TM)
total 0
lr-x-- 1 vamiris1 ccusers 64 Jan  8 18:57 0 -> /dev/null
l-wx-- 1 vamiris1 ccusers 64 Jan  8 18:57 1 -> 
/home/vamiris1/tomcat5.5.28/logs/catalina.out
l-wx-- 1 vamiris1 ccusers 64 Jan  8 18:57 10 -> 
/home/vamiris1/tomcat5.5.28/logs/catalina.2010-01-08.log
l-wx-- 1 vamiris1 ccusers 64 Jan  8 18:57 11 -> 
/home/vamiris1/tomcat5.5.28/logs/localhost.2010-01-08.log
l-wx-- 1 vamiris1 ccusers 64 Jan  8 18:57 12 -> 
/home/vamiris1/tomcat5.5.28/logs/manager.2010-01-08.log
l-wx-- 1 vamiris1 ccusers 64 Jan  8 18:57 13 -> 
/home/vamiris1/tomcat5.5.28/logs/admin.2010-01-08.log
l-wx-- 1 vamiris1 ccusers 64 Jan  8 18:57 14 -> 
/home/vamiris1/tomcat5.5.28/logs/host-manager.2010-01-08.log
lr-x-- 1 vamiris1 ccusers 64 Jan  8 18:57 15 -> 
/home/vamiris1/tomcat5.5.28/common/i18n/tomcat-i18n-en.jar
lr-x-- 1 vamiris1 ccusers 64 Jan  8 18:57 16 -> 
/home/vamiris1/tomcat5.5.28/common/i18n/tomcat-i18n-es.jar
lr-x-- 1 vamiris1 ccusers 64 Jan  8 18:57 17 -> 
/home/vamiris1/tomcat5.5.28/common/i18n/tomcat-i18n-fr.jar
lr-x-- 1 vamiris1 ccusers 64 Jan  8 18:57 18 -> 
/home/vamiris1/tomcat5.5.28/common/i18n/tomcat-i18n-ja.jar
lr-x-- 1 vamiris1 ccusers 64 Jan  8 18:57 19 -> 
/home/vamiris1/tomcat5.5.28/common/lib/commons-el.jar
l-wx-- 1 vamiris1 ccusers 64 Jan  8 18:57 2 -> 
/home/vamiris1/tomcat5.5.28/logs/catalina.out
lr-x-- 1 vamiris1 ccusers 64 Jan  8 18:57 20 -> 
/home/vamiris1/tomcat5.5.28/common/lib/jasper-compiler-jdt.jar
lr-x-- 1 vamiris1 ccusers 64 Jan  8 18:57 21 -> 
/home/vamiris1/tomcat5.5.28/common/lib/jasper-compiler.jar
lr-x-- 1 vamiris1 ccusers 64 Jan  8 18:57 22 -> 
/home/vamiris1/tomcat5.5.28/common/lib/jasper-runtime.jar
lr-x-- 1 vamiris1 ccusers 64 Jan  8 18:57 23 -> 
/home/vamiris1/tomcat5.5.28/common/lib/jsp-api.jar
lr-x-- 1 vamiris1 ccusers 64 Jan  8 18:57 24 -> 
/home/vamiris1/tomcat5.5.28/common/lib/naming-factory-dbcp.jar
lr-x-- 1 vamiris1 ccusers 64 Jan  8 18:57 25 -> 
/home/vamiris1/tomcat5.5.28/common/lib/naming-factory.jar
lr-x-- 1 vamiris1 ccusers 64 Jan  8 18:57 26 -> 
/home/vamiris1/tomcat5.5.28/common/lib/naming-resources.jar
lr-x-- 1 vamiris1 ccusers 64 Jan  8 18:57 27 -> 
/home/vamiris1/tomcat5.5.28/common/lib/servlet-api.jar
lr-x-- 1 vamiris1 ccusers 64 Jan  8 18:57 28 -> 
/home/vamiris1/tomcat5.5.28/server/lib/catalina-ant-jmx.jar
lr-x

Re: Tomcat Filter Mapping Issue

2010-01-11 Thread Mark Thomas
On 10/01/2010 23:25, Caldarale, Charles R wrote:
>> From: Patrick Flaherty [mailto:pflah...@rampageinc.com]
>> Sent: 2010 January 10, Sunday 16:28
>> To: Tomcat Users List
>>
>> Can anyone post a virtual host snippet from their server.xml ?
> 
> Better if you post your server.xml and the  elements from your 
> webapps (which should not be in server.xml).

For the sake of completeness, there is an exception to this
rule/guideline. If you set autoDeploy=false and deployOnStartup=false on
a host then you have to define your contexts in server.xml.

Defining contexts in server.xml is discouraged if you don't need to as
it means you have to restart Tomcat if you make a change.

Mark



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org