Re: Re : Memory leak in Tomcat 6.0.35 ( 64 bit)

2013-04-03 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Saumil,

Please try to keep discussions on the mailing list to everyone can
benefit.

On 4/2/13 6:48 PM, saumil shah wrote:
 For some reason ...I do not see Java process in Task Manager in 
 Windows, just Tomcat6 process. I am assuming killing Tomcat6 kills 
 JVM internally...is this correct assumption ?

I'm not sure what the Tomca6 process is, but if you kill the service
(and nothing goes wrong), the JVM should terminate.

 Also, I am NOT re-deploying the application WAR's for some 
 reason...when I deployed the application using Tomcat Manager ... 
 for some reason it put WAR in the WebApps folder and then exploded 
 them.

That is entirely expected behavior. If you don't want your webapps to
be deployed on startup, you'll need to set deployOnStartup=false in
your Host.

If you set deplyOnStartup=false, you'll have to use the Manager
webapp to deploy your webapps after Tomcat has started.

 Now it seems every time I start Tomcat , it tries to Re-deploy the 
 application because it finds .WAR there ?

I wouldn't use the term re-deploy since the webapp isn't running
prior to that. I usually use the term re-deploy to mean that the
webapp is taken out of service in a running Tomcat, then a new webapp
is deployed in its place (usually on the same context path).

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJRXD5GAAoJEBzwKT+lPKRYq0gQAJZ9E4OSrYj+ypDTmHUV5ADa
GdUbo/TYfyZNPFjmHzl/GYeZlYTirs24dA95VacIiAdJhtZ2g0J44Oc6PnT9pqmR
RxcGtqNF+kN+AV5i0Lf4ewAZE8MQBvWmBHumqt75ETEsYYAlEv0NaVza9EcM7DNi
RTpR9MrD4QUS7jhrKsyvQiagL7hF8xJgDij9CY5Bc5j6wQjuh6nttW4JtJXOTxb1
iiMbQqndmX0RkZHY3Dw3BJOuFU/NjAmSGB5pfmDBrA+z6jasH4SZd0KOy3DKcSgX
EV8ja57U161yJMdH7Bt7ap9C2mpAaoFKMvANaPYCy29oRcUgQ3qMB7lofRCy2NZ5
JDWDnVaKa4UdXoCK4pUvt/noo4EZwUhHI9y8IAtCOC+5xgEDA65FPeTnXBBWYqyu
uASODSRe4DdQYfLJjMw6rWmGFCqM+aPICeZKcXlC+UR8eqp3pmoLL1I5Y15xth2y
mW9dA/qVAUNLUXlW1oWw7b58UAyCi7nVSASC4p3LcQ1K+cnQ8j8/VB0GtMMgA2gL
Bpk7RR19NlzeUXmK//AN/BthZY6oK09qz6n+yNTi2tiV4T2XCjlRO4dsLOoW73nP
FPTMSFfzYaeBKkn0pHsORZLCtWz8bZ060dYrfKkKLSKhk11CzwGNeP4A5So9xa+J
ncBMVYTGyKnanbDE3Fj9
=dZYT
-END PGP SIGNATURE-

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



Re: how to monitor the traffic through the connector

2013-04-03 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Jeffrey,

On 4/1/13 3:52 PM, Jeffrey Janner wrote:
 -Original Message- From: Daniel Mikusa
 [mailto:dmik...@vmware.com] Sent: Monday, April 01, 2013 1:09 PM 
 To: Tomcat Users List Subject: Re: how to monitor the traffic
 through the connector
 
 On Apr 1, 2013, at 1:40 PM, a wrote:
 
 Hi,
 
 Thank you for reply. The servlet of the web application does
 not response to the request after running serveral months. The
 problem can be solved by
 restarting the tomcat.
 I want to troubleshoot by monitoring the number of avaliable
 threads or occupied threads.
 
 Thank you
 
 
 First, don't top post (i.e. reply at the top of your email).
 Either reply below the previous response or as typically works
 best, inline.
 
 Second, when you encounter a problem with your servlet / Tomcat,
 take three or four thread dump, separated by 15 - 20 seconds
 each.  Each thread dump will show you the current status of all
 the threads in the JVM.  You can use the thread dumps to check
 for block threads and long running processes.
 
 Instructions for taking a thread dump.
 
 
 https://wiki.apache.org/tomcat/HowTo#How_do_I_obtain_a_thread_dump_of_m

 
y_running_webapp_.3F
 
 Dan
 
 
 FWIW, I've found jconsole immensely helpful in sorting out blocked
 threads. And none of that manually searching through dumps.

Jconsole is notoriously difficult to get running on a remote server
(unless it's running Microsoft Windows, but then again I can't imagine
a Windows server that stays running for several months where the
webapp turns out to be the problem ;).

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJRXEfkAAoJEBzwKT+lPKRYKPUQAJIshzZVPoxPaqbBGLb6IzXe
ChSiwK40Jo/LtniAxMkpgtraXXCatDCLK9TZKrc7QsnaYePcJTTuJylYF/cbDox9
6SvFMOWlvbm4ZX+Qj7jnKj5UkNIbuws7PHEFtD5s+2HyuXe5DSl/xTwlbW25cAi6
GwXI/HbhwwFAqLWkgf9AMyfA8SQT0YEYmC8hhBtz6lfJYP0xiN6oqeIuOgnJAFJf
YU+ITSyiKyqHboNjnoz4OtTgQGbxVuGjeAeJKVjTJVL2qpHmVWHekV53/4Qps/nk
vW55K3ah7K+e0xETZpHE1Wdbse189DDM2GEWvoEGANHjLnvJ19ugvs08IQ4xIR19
orZmSBf7RSFqR6MSwT2N6YrFTKnGij/yQXYg6oxJkF0/0Ep6frWxf8xfUis5+Muo
/WcsW5nNFbrFHDWuAifPNT1HPXVtftJ/VxZs43Fsht6618pfFZMpQStqmUUWmbVb
31uTaZk7karGhdQuMFqQNMLhUcj6jhsZEQJPiozO/oc2GUznQfz8TcaRVhtiElxf
PEUICU23hBVOHqOhfozmC5a1opFVbpSTvH2KHcdAkaJB1NrBtsKcA0GPTH8S4E5K
y6Ld3TdrLXvpuu6d1tyfLtkaMixT5GnqbALiOPLvZFOKoSw99VQCUpj+NBeMvn5M
RRrBwOu10/oV64H9SNvP
=mPr8
-END PGP SIGNATURE-

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



RE: Re : Memory leak in Tomcat 6.0.35 ( 64 bit)

2013-04-03 Thread saumil shah
Thanks again Chris  
I did change in Tomcat 6.0/Conf/server.xml
unpackWARs=false and autoDeploy=false
but the logs still complaint about the Deploying web applications
org.apache.catalina.startup.HostConfig deployWARINFO: Deploying web application 
archive 
CmcAppActions.warorg.apache.catalina.core.StandardContextaddApplicationListenerINFO:
 The listener com.sun.faces.config.ConfigureListener is alreadyconfigured for 
this context. The duplicate definition has been ignored.
2.  Also for a 64 bit JVM , could I then just bump up my Tomcat Java params as :
-Xms1024m -Xmx4096m  instead of my default as  -Xms512m -Xmx1024m
-XX:MaxPermSize=1024m instead of my default -XX:MaxPermSize=512m

Appreciate all your help.
Thanks again.
 Date: Wed, 3 Apr 2013 10:35:50 -0400
 From: ch...@christopherschultz.net
 To: users@tomcat.apache.org
 CC: saumil...@hotmail.com
 Subject: Re: Re : Memory leak in Tomcat 6.0.35 ( 64 bit)
 
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA256
 
 Saumil,
 
 Please try to keep discussions on the mailing list to everyone can
 benefit.
 
 On 4/2/13 6:48 PM, saumil shah wrote:
  For some reason ...I do not see Java process in Task Manager in 
  Windows, just Tomcat6 process. I am assuming killing Tomcat6 kills 
  JVM internally...is this correct assumption ?
 
 I'm not sure what the Tomca6 process is, but if you kill the service
 (and nothing goes wrong), the JVM should terminate.
 
  Also, I am NOT re-deploying the application WAR's for some 
  reason...when I deployed the application using Tomcat Manager ... 
  for some reason it put WAR in the WebApps folder and then exploded 
  them.
 
 That is entirely expected behavior. If you don't want your webapps to
 be deployed on startup, you'll need to set deployOnStartup=false in
 your Host.
 
 If you set deplyOnStartup=false, you'll have to use the Manager
 webapp to deploy your webapps after Tomcat has started.
 
  Now it seems every time I start Tomcat , it tries to Re-deploy the 
  application because it finds .WAR there ?
 
 I wouldn't use the term re-deploy since the webapp isn't running
 prior to that. I usually use the term re-deploy to mean that the
 webapp is taken out of service in a running Tomcat, then a new webapp
 is deployed in its place (usually on the same context path).
 
 - -chris
 -BEGIN PGP SIGNATURE-
 Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
 Comment: GPGTools - http://gpgtools.org
 Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
 
 iQIcBAEBCAAGBQJRXD5GAAoJEBzwKT+lPKRYq0gQAJZ9E4OSrYj+ypDTmHUV5ADa
 GdUbo/TYfyZNPFjmHzl/GYeZlYTirs24dA95VacIiAdJhtZ2g0J44Oc6PnT9pqmR
 RxcGtqNF+kN+AV5i0Lf4ewAZE8MQBvWmBHumqt75ETEsYYAlEv0NaVza9EcM7DNi
 RTpR9MrD4QUS7jhrKsyvQiagL7hF8xJgDij9CY5Bc5j6wQjuh6nttW4JtJXOTxb1
 iiMbQqndmX0RkZHY3Dw3BJOuFU/NjAmSGB5pfmDBrA+z6jasH4SZd0KOy3DKcSgX
 EV8ja57U161yJMdH7Bt7ap9C2mpAaoFKMvANaPYCy29oRcUgQ3qMB7lofRCy2NZ5
 JDWDnVaKa4UdXoCK4pUvt/noo4EZwUhHI9y8IAtCOC+5xgEDA65FPeTnXBBWYqyu
 uASODSRe4DdQYfLJjMw6rWmGFCqM+aPICeZKcXlC+UR8eqp3pmoLL1I5Y15xth2y
 mW9dA/qVAUNLUXlW1oWw7b58UAyCi7nVSASC4p3LcQ1K+cnQ8j8/VB0GtMMgA2gL
 Bpk7RR19NlzeUXmK//AN/BthZY6oK09qz6n+yNTi2tiV4T2XCjlRO4dsLOoW73nP
 FPTMSFfzYaeBKkn0pHsORZLCtWz8bZ060dYrfKkKLSKhk11CzwGNeP4A5So9xa+J
 ncBMVYTGyKnanbDE3Fj9
 =dZYT
 -END PGP SIGNATURE-
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 
  

Re: Re : Memory leak in Tomcat 6.0.35 ( 64 bit)

2013-04-03 Thread Howard W. Smith, Jr.
Chris,

On Tue, Apr 2, 2013 at 5:12 PM, Christopher Schultz 
ch...@christopherschultz.net wrote:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA256


  I understand its not a premanent solution but as a stopgap for now
  ? If so , we can put it as part of daily cycle to bounce tomcat6.

 If you don't re-deploy your webapp, then daily rolling Tomcat restarts
 are not necessary. I wonder why you are re-deploying your web
 application so many times?


As a new tomcat user and still somewhat junior java/jsf developer, I
restart tomcat whenever I have new software changes to
deploy-and-want-to-run-on the production server. sometimes, I
deploy-and-restart multiple times per day, but sometimes, I'm able to let
tomcat/tomee run for days without restart.


 We run several Tomcats in parallel with modest heaps (less than 512MiB
 each) and they can run for months before we stop them for upgrades. It
 *is* possible to run JVMs without running out of memory...


I too, have not experienced any OOME, and recently, per what I have
seen-and-read of other (more senior java developers than myself), I have
decreased memory settings in my java options on tomcat7w.exe (see below).

-Xmx1024m
-XX:MaxPermSize=384m
-XX:+UseTLAB
-XX:+UseConcMarkSweepGC
-XX:+CMSClassUnloadingEnabled

On Java tab of tomcat7w.exe, have the following specified:

Initial memory pool = 256
Maximum memory pool =
Thread stack size   =


My Windows 2008 R2 Server (64bit 32GB RAM) never seems to get higher than
1% CPU, and I think I do have memory leaks somewhere in the app, but FWIW
(in heap dump in java visual vm), the memory leaks seem to be tomee leaks.
In Java Visual VM, I do see the memory grow over time, as the app is used
(without a tomcat restart or re-deploy of app and then restart tomcat), but
I still have not seen OOME...'yet'.

I should leave the server up and running without restarting tomcat, but
when I need to deploy new software changes, i can't wait to deploy. :)

My apologies, not trying to hijack the thread. just sharing my response to
your comments.

Howard




 - -chris
 -BEGIN PGP SIGNATURE-
 Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
 Comment: GPGTools - http://gpgtools.org
 Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

 iQIcBAEBCAAGBQJRW0m2AAoJEBzwKT+lPKRYt38QAJkMt1+S+h48OdnVU8GVNY+x
 nhBJMX2THAN9d6LIo7k/8bEUPlbBIbjZVHZeR7tPbt3HgcPaPXLZ+/eiPU7x3tEe
 ubn/Vp7WVNhrZ3+ZcHQz6AEBz5JfFoHNpwfPvopTxsClhdlbNkQVLoNQX2DHvao6
 ARFG3pZWX8HlC/MYMoIsJLD6DxXj9zT0E1ZJzBImHt8r2zE9YPWo35k6RhnEjLut
 Ol74NejK8kD8orgGfJfz5bM6XXiWaxLm3tBXkukefcEC9Sq5/PMDP61npTBygFgK
 GhPCoKHfvxtm/oXIFHJrwfibpyoKa5gxdRPRey9PqqKc9zABw8t7oMHb/QxwC6qi
 qNe9xy5/iSK3NKqQLawXMsFmGfmTA2Rx13I0uP7TnP/2X0bjdjNa/uHx+VKPYY/U
 RfdqosN02x8BwXkXbDRzeQURiTAPwSKdH8PBL9itnYSLGi6byYynfsvsPeycbpuK
 zV0qdyvBOeHbz/j5dai7Z451PMxm5ccEZ1B8cPtQiRVXxx5+5lF3q9RFwtkenLbI
 IpfIrpj4D+96KP66Rn0yfVNEeHosljAOJaYLHuexObna2jjkqwgttzQW4KVajeZm
 I1BPQOSHCQVg+Qo2ewVpd6YrnygpTRF6XsKhA/gwuHS+Jy5xJVsXMPNO/kl0y/6f
 k9TjfhdTRUpMqn5siO68
 =DjF0
 -END PGP SIGNATURE-

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




Buggy java native call kills tomcat

2013-04-03 Thread Dale Ogilvie
Hi all,

 

Saw this recently... Some java native code included in our tomcat
deployment contained an error, which caused a JVM segfault when a
webapp called the routine.

 

I was startled by the fact that this native code error brought down the
entire tomcat instance (all 15+ web apps) due to a fault in a native
library (installed in tomcat/lib) called by one app.

 

This would have been very scary if this happened in PROD instead of
dev/test.

 

My question: can we protect ourselves from total instance failure, i.e.
restrict the damage to the death of just the app calling the native
library? Is there a way to make the tomcat VM survive a badly written
native component?

 

Thanks

 

Dale



RE: Buggy java native call kills tomcat

2013-04-03 Thread Caldarale, Charles R
 From: Dale Ogilvie [mailto:dale_ogil...@trimble.com] 
 Subject: Buggy java native call kills tomcat

 My question: can we protect ourselves from total instance failure, i.e.
 restrict the damage to the death of just the app calling the native
 library? Is there a way to make the tomcat VM survive a badly written
 native component?

Simple answer: nope.  In a Windows or Linux environment, native code has full 
access to the entire address space of the process, and can therefore scribble 
over anything it feels like, corrupting the JVM.  In general, you should try to 
avoid native code called from Java like the plague; not doing so means you 
might as well write in C (or worse, C++).  If you must use native code, running 
it in a separate process and communicating with it via pipes or sockets is much 
safer, but then you have to deal with timeouts and other error recovery issues. 
 Another option is to run a webapp that uses native code in a separate Tomcat 
instance (using a different port), and forward requests to it from the primary 
Tomcat.

 - 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