RE: Local VisualVM connection to Tomcat

2013-07-24 Thread honyk
On 2013-06-28 Christopher Schultz wrote:
 On 6/27/13 5:17 PM, honyk wrote:
  On 2013-06-27 Christopher Schultz wrote:
  On 6/27/13 4:31 PM, honyk wrote:
  I am constantly encountering PermGen errors despite quite high
  PermGen limit (even 512m) and many options set - approx once a
  week under not heavy load.
 
  Like what kinds of options? What kind of load? What does the
  error look like? Are you re-deploying your webapp without
  restarting Tomcat, or do you bust PermGen even with a single
  deployment?
 
  Tomcat runs as service using these Java opts (tomcat7w.exe) -
  single line
 
  -Duser.language=en -XX:MaxPermSize=512m -XX:+DisableExplicitGC
  -XX:+CMSClassUnloadingEnabled -XX:+CMSPermGenSweepingEnabled
 
  Originally I used Apache JkMount/Worker to hide that port number.
  In that case there were listed these errors in the tomcat err log:
  Exception in thread ajp-bio-8009-exec-7
  java.lang.OutOfMemoryError: PermGen space
 
 I recommend that you run with -XX:+HeapDumpOnOutOfMemoryError and
 possibly also with -XX:HeapDumpPath=[path to where you want your heap
 dumps to go].

All my options were specified on a single line and thus ignored.
This is the reason why I was getting PermGen errors constantly even when high 
values were specified...

My default value is approx. 85 MB and when all my web apps are invoked, cca 90 
MB is needed. 

Currently I use these settings (JDK 7):
-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.ssl=false
-Duser.language=en
-XX:+DisableExplicitGC
-XX:MaxPermSize=128m
-XX:+HeapDumpOnOutOfMemoryError
-XX:HeapDumpPath=C:/DataStorage/tomcat-heap-dump
-XX:OnOutOfMemoryError=C:\trunk\Tools\Macros\TomcatKiller\task.bat %p

I removed following options as they seem to be obsolete (?) in JDK 7:
-XX:+CMSClassUnloadingEnabled 
-XX:+CMSPermGenSweepingEnabled

Now my tomcat instance works fine. When OOME occurs (I hope it will never 
happen :), dump is created and my script executed (taskkill /F /PID %1 + 
sending e-mail to me). The tomcat windows service is set to restart itself one 
minute after the first failure (which is triggered when process is killed). My 
apps are simple tools and reports, nothing critical, so I hope this autokilling 
doesn't harm.

I still cannot profile the JVM locally, but this is not an issue any more. For 
basic tomcat monitoring the JMX capabilities are sufficent. But my thread in 
VisualVM forum is still opened and in case of any update I'll let you know.

Thanks you guys for your hints, I learned a lot from your responses recently!

Regards, Jan


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



RE: Local VisualVM connection to Tomcat

2013-07-23 Thread honyk
On 2013-07-23 Eugène Adell wrote:
 On Mon, Jul 22, 2013 at 3:10 PM, honyk j.tosov...@email.cz wrote: 
  On 2013-06-28 Christopher Schultz wrote:
   On 6/27/13 5:17 PM, honyk wrote:
I realized that my tomcat runs as a service but I am logged as an
user and in this case the tomcat is not visible to me. 
  
   Try running VisualVM as an administrator.
 
  I've found the problem, but I have no remedy for it yet.
  https://java.net/projects/visualvm/lists/users/archive/2013-
 07/message/2
 
  Briefly, the service uses the TMP environment variable as it is
 specified
  for the given user, but when that user is logged remotely, the suffix
  \session_number is added at the end of this path so these both do
 not
  match and VisualVM doesn't detect my tomcat/JVM as expected.
 

 I had a similar problem when using jps/jstat and finally I found
 someone advising to use -J-Djava.io.tmpdir option. It worked for me,
 try adding -J-Djava.io.tmpdir when calling visualvm

This helped a bit. Now I can see two extra Unknown Applications, but
without any details. One pid belongs to tomcat. From this
http://visualvm.java.net/troubleshooting.html I suppose I changed only one
of two paths which should match: 
While 'java.io.tmpdir' is now %TMP%\hsperfdata_username, ?jvmstat? is still
looking for the content here: %TMP%\SessionNumber\hsperfdata_username

I'll consult this behaviour with VisualVM developers.

Jan



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



RE: Local VisualVM connection to Tomcat

2013-07-22 Thread honyk
On 2013-06-28 Christopher Schultz wrote:
 On 6/27/13 5:17 PM, honyk wrote:
  I realized that my tomcat runs as a service but I am logged as an
  user and in this case the tomcat is not visible to me. I'll test it
  differently tomorrow.
 
 Try running VisualVM as an administrator.

I've found the problem, but I have no remedy for it yet.
https://java.net/projects/visualvm/lists/users/archive/2013-07/message/2

Briefly, the service uses the TMP environment variable as it is specified for 
the given user, but when that user is logged remotely, the suffix 
\session_number is added at the end of this path so these both do not match 
and VisualVM doesn't detect my tomcat/JVM as expected.

Jan


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



Re: Local VisualVM connection to Tomcat

2013-07-22 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Jan,

On 7/22/13 3:10 PM, honyk wrote:
 On 2013-06-28 Christopher Schultz wrote:
 On 6/27/13 5:17 PM, honyk wrote:
 I realized that my tomcat runs as a service but I am logged as
 an user and in this case the tomcat is not visible to me. I'll
 test it differently tomorrow.
 
 Try running VisualVM as an administrator.
 
 I've found the problem, but I have no remedy for it yet. 
 https://java.net/projects/visualvm/lists/users/archive/2013-07/message/2

  Briefly, the service uses the TMP environment variable as it is
 specified for the given user, but when that user is logged
 remotely, the suffix \session_number is added at the end of this
 path so these both do not match and VisualVM doesn't detect my
 tomcat/JVM as expected.

Umm... set the TMP variable to something specific and stick with it?

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

iQIcBAEBCAAGBQJR7bLlAAoJEBzwKT+lPKRYJQ8P/3TnFK/B+g+0L7K4TiXBm2Lu
bTVLdBRiXyZLZ/WgJNQ9B3EoDi5F0obuY6liWE2NzTbKtPXDAZm/qRJ2FG4xAyHV
LVfVPrbo7jlglYu9K0RcXBAsxTyMf39B/B1Nm1UyA8gJ4lT2xyEGLjJbgtHXnHyE
XLmc9b9C4JeT+AlF2q3Bczjg9z0WQp0QTgx/8oks4lqlSkj4e/Fxx7kL12uybHJ7
c2y6iMFxXiviayv/xJLcGT7nDR4Wwt+oSfdI0mUt6L28ZwllkZzMAAYy94cpFknz
GJ4qKQmc5MhbaCQZ1Nm6F1IvGCKiDdmWqrPN+oehd6kR29YJPpAY9+AUEtBFrXP9
v50WyYEdogbJEM1TRBvx+kqkfCYjWxnPQ5rf/b5amJyZOGvjvol4Fu6CBp4MP64D
OBqYMgLkB+93l6Ptw9BGwNx6cQG2db/QZ6JdGgP991GV7bxDgirxAOzEq6n1BLVV
n/OPDtdMOEgFE3ol7IMOYquVEgV53urPHgrG9lKJSzSDWoYysTSPUnIF8QRz4eBE
0+LJCpe1+vBE4WZ2b6K4hgq4+i0zw8ib16A0RuQbUxoOoAK4Y2tQ9cNZdjgSUQ8N
3iBOCGjTFLCyfOK4Lw5moaz7retx3B9HK33+sa6DTBsSFwF1qfDEl9qmbgXIGCdd
SyrSCpqFliiq2s6Y/yw2
=JwRo
-END PGP SIGNATURE-

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



Re: Local VisualVM connection to Tomcat

2013-07-22 Thread Howard W. Smith, Jr.
On Mon, Jul 22, 2013 at 3:10 PM, honyk j.tosov...@email.cz wrote:

 On 2013-06-28 Christopher Schultz wrote:
  On 6/27/13 5:17 PM, honyk wrote:
   I realized that my tomcat runs as a service but I am logged as an
   user and in this case the tomcat is not visible to me. I'll test it
   differently tomorrow.
 
  Try running VisualVM as an administrator.

 I've found the problem, but I have no remedy for it yet.
 https://java.net/projects/visualvm/lists/users/archive/2013-07/message/2

 Briefly, the service uses the TMP environment variable as it is specified
 for the given user, but when that user is logged remotely, the suffix
 \session_number is added at the end of this path so these both do not
 match and VisualVM doesn't detect my tomcat/JVM as expected.


I know Chris bashed me for this earlier (on this list), politely, and/or
recommended or said something about not to login via administrator into my
Windows Server 2008 R2 web app server running TomEE (tomcat7), but...

in response to this thread, I login to my Windows SErver 2008 R2 web app
server, always, as administrator, and yes (confirmed as Chuck mentioned
earlier in this thread),

 The possibility of services interacting with the desktop disappeared some
time ago.

so, I just specify a JMX port in my java settings for my TomEE (tomcat7)
running as windows service, and specify the JMX port in Java Visual VM, and
voila, I think this is saved to Windows registry (or somewhere), and I
always see my TomEE (tomcat7) instance when I run Java Visual VM.

Of course, the JMX port is not opened on the firewall/router. i just login
remotely via remote desktop connection and do what I need to do (stop
tomcat7 service, update my app in tomee/webapps, and start tomcat7 service).

Others may disagree, but i have found this to be quite secure and as it was
said earlier in this thread... a piece of cake. :)


Re: Local VisualVM connection to Tomcat

2013-06-28 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Jan,

On 6/27/13 5:17 PM, honyk wrote:
 On 2013-06-27 Christopher Schultz wrote:
 On 6/27/13 4:31 PM, honyk wrote:
 I am constantly encountering PermGen errors despite quite high 
 PermGen limit (even 512m) and many options set - approx once a
 week under not heavy load.
 
 Like what kinds of options? What kind of load? What does the
 error look like? Are you re-deploying your webapp without
 restarting Tomcat, or do you bust PermGen even with a single
 deployment?
 
 Tomcat runs as service using these Java opts (tomcat7w.exe) -
 single line
 
 -Duser.language=en -XX:MaxPermSize=512m -XX:+DisableExplicitGC 
 -XX:+CMSClassUnloadingEnabled -XX:+CMSPermGenSweepingEnabled
 
 Originally I used Apache JkMount/Worker to hide that port number.
 In that case there were listed these errors in the tomcat err log: 
 Exception in thread ajp-bio-8009-exec-7
 java.lang.OutOfMemoryError: PermGen space

I recommend that you run with -XX:+HeapDumpOnOutOfMemoryError and
possibly also with -XX:HeapDumpPath=[path to where you want your heap
dumps to go].

If/when your service busts PermGen, you should be able to inspect the
dump and see what all the java.lang.Class objects are. I suppose it's
possible that you have a lot of intern'd String objects as well (if
you are on Java 1.6 or lower... you didn't say), but it's usually
java.lang.Class objects.

 Now I use proxypass like this (hoping this is preffered way): 
 ProxyPass /my-app ajp://localhost:8009/my-app
 
 and in this case I can see just Exception in thread
 ajp-bio-8009-exec-4 without any details (but I suppose it is the
 same PermGen one)

Your choice of connector should not be relevant. Neither mod_jk not
mod_proxy_ajp are preferred... they each have their own advantages.

 I do not hot deploy my apps. They are JSF2.0/Mojarra powered, some
  of them access database a generate various reports.

Do you use RMI or a lot of proxies? How about JSF and/or Mojarra? Both
RIM and Proxy classes end up generating lots of junk Class objects and
can fill your PermGen.

Given that you already have 512MiB of PermGen, you have obviously
changed this from the default. Have you tried raising it up to say
1GiB just to see what happen. It is entirely possible that, for your
application, you really just need a whole bunch of PermGen. It's not
likely, but it's possible.

 I am trying to investigate what the app causes this, but I
 haven't succeeded in reproducing it locally yet.
 
 I found several articles about VisualVM (I hope it could help
 me to determine some PermGen issues) and connecting it to the
 Tomcat. Remotely. But I have no clue how can I conect the local
 VisualVM to tomcat that runs on localhost.
 
 Even here it is written: 
 http://tomcat.apache.org/tomcat-7.0-doc/monitoring.html
 
 Enabling JMX Remote Note: This configuration is needed only if
 you are going to monitor Tomcat remotely. It is not needed if
 you are going to monitor it locally, using the same user that
 Tomcat runs with.
 
 But there is no further description for that simpler (local) 
 method. If it is obvious, sorry, but I am lost here ;-)
 
 Connecting to a Tomcat running on localhost is dead simple:
 
 1. Launch VisualVM 2. Once the main screen loads, double-click on
 Tomcat from the Local cluster of applications 3. Profit
 
 Now I've found this interesting article: 
 https://blogs.oracle.com/nbprofiler/entry/monitoring_java_processes_running_as

  I realized that my tomcat runs as a service but I am logged as an
 user and in this case the tomcat is not visible to me. I'll test it
 differently tomorrow.

Try running VisualVM as an administrator.

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

iQIcBAEBCAAGBQJRzZVaAAoJEBzwKT+lPKRYvYYQAMB3XYAmxbOawBA22foHRrDZ
UROJRujWEPsOrPOrjq6UiMidK7F73hhDsejx1YTBUUyXM6NtCmt8yAP1TWdc0VcT
7qI1Q0HsyHeYpbjd5gHTsJYkoVK2abD8cQAnxgbns8PxlDaaUvdqnRcA4wLJVCzK
Cw7ghoH9z5Yltbww5Mqne/pb9drXJoq02XUdbrEV4gejqK7t8Ow8OsSo4/izlG2k
08qu+PZ9UNYRt0Dihpx8QflLqv9Xu5HfpUwVWTRE5+uQgc0AaAExxR60xqAoYRL8
+YIi72JWiXWrQkceHDvSnP4w+SM8DfhI/SQtqMzJNoBIbbAgIMckqqm4LI+ngY+w
eJa/wc/d6R186PTzT2Sd1TmiWDWLdw/CqSTOoXE7fryMthJiovxtvmhTrLsrwoKL
WkbOTtXTPQduk8A1FHh/Y08ByGKNfwEapkQCsVidQyDmq2Y7Yrsb5cYYF5JiHFc6
tsqU6H+h5EAMPr0Nslt2WHyDIjFtZoIsn0hCNJ3CUAX9BUSyTQapP9TLxGxqN/Vo
Ihykp2jtufQ2pEZkFZb3mE08CvX6ihdAmC4losvLXGCc5rzulBGr2BhuSTs3IXaF
SakWdoj+cvXXtQBtUPTAHxML8inMn3qDit6BB5oBW5VeMQ0FOeemYlDyCjNVf0SA
wBddCxlm7mUS0p2dTXCF
=0rQS
-END PGP SIGNATURE-

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



Local VisualVM connection to Tomcat

2013-06-27 Thread honyk
Dear All,

I am constantly encountering PermGen errors despite quite high PermGen limit
(even 512m) and many options set - approx once a week under not heavy load.

I am trying to investigate what the app causes this, but I haven't succeeded
in reproducing it locally yet.

I found several articles about VisualVM (I hope it could help me to
determine some PermGen issues) and connecting it to the Tomcat. Remotely.
But I have no clue how can I conect the local VisualVM to tomcat that runs
on localhost.

Even here it is written:
http://tomcat.apache.org/tomcat-7.0-doc/monitoring.html

Enabling JMX Remote
Note: This configuration is needed only if you are going to monitor Tomcat
remotely. It is not needed if you are going to monitor it locally, using the
same user that Tomcat runs with.

But there is no further description for that simpler (local) method. If it
is obvious, sorry, but I am lost here ;-)

Thanks, Jan


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



Re: Local VisualVM connection to Tomcat

2013-06-27 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Jan,

On 6/27/13 4:31 PM, honyk wrote:
 I am constantly encountering PermGen errors despite quite high
 PermGen limit (even 512m) and many options set - approx once a week
 under not heavy load.

Like what kinds of options? What kind of load? What does the error
look like? Are you re-deploying your webapp without restarting Tomcat,
or do you bust PermGen even with a single deployment?

 I am trying to investigate what the app causes this, but I haven't
 succeeded in reproducing it locally yet.
 
 I found several articles about VisualVM (I hope it could help me
 to determine some PermGen issues) and connecting it to the Tomcat.
 Remotely. But I have no clue how can I conect the local VisualVM to
 tomcat that runs on localhost.
 
 Even here it is written: 
 http://tomcat.apache.org/tomcat-7.0-doc/monitoring.html
 
 Enabling JMX Remote Note: This configuration is needed only if you
 are going to monitor Tomcat remotely. It is not needed if you are
 going to monitor it locally, using the same user that Tomcat runs
 with.
 
 But there is no further description for that simpler (local)
 method. If it is obvious, sorry, but I am lost here ;-)

Connecting to a Tomcat running on localhost is dead simple:

1. Launch VisualVM
2. Once the main screen loads, double-click on Tomcat from the
Local cluster of applications
3. Profit

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

iQIcBAEBCAAGBQJRzKYyAAoJEBzwKT+lPKRY2AgP+gIZjRI1FAuvYJxHpRT5k+yZ
VKIf5ShZ7t/asGm9E5eWulAKDcLraNKqKN8JILt6vM76PfA4ldBwX17uPu1H/8vT
O8P6JSuNyWm+Euk3dUlgo0uz9SuEE4H4JjQZJNf3bpGJEBkzlsaKMvBNZVtdx9nI
JZaxV55KvQ8q+A4SSByr4V7S3pd3Dp8L1Zx9NsiYcBtigPSwXydYC14rgGslHuxC
se0FNN8H1K+wcxFm26/3Db1lxPu69zy0jC5sTGPoUIG26YdWIWchggJdHsfB3y4o
zG9TO+Y7z3Xv4vO5xb46gKxYp/q50X4TE4qr07/xkT7vxf6RqFVGPbTr0LLlEweE
EP76aR1kQJgba/JHitNJEd7/IgScs9PGgiZ5gbxUoTQeb4eVO2VGvicM9FxqcR20
NwpuBLNTezlQ5fHpQajB4grLy9iFKES8CUL5LBpuq6e9+ub1yr4ZElJclX2KXfad
TeV4bXGUmz8wf/fsAixEswpLxj510ztkg3akre/5znYp34rjj5mmJMGNSCj5/Obk
iAQr5P7ilEYW61ZVsFQVFQPRlM/eY+0DCi8KeErvEL5LD8VVFiUs1E+Bfh5BAltj
deQPEO9IZzc5ZIlT9Yfc0XQ/SS353S2KpmqkvAqh/KYY+BwJbEoVR5d0xTHcvbhR
QbVATyzVvdjr3+GRqXiJ
=o1uO
-END PGP SIGNATURE-

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



RE: Local VisualVM connection to Tomcat

2013-06-27 Thread Caldarale, Charles R
 From: honyk [mailto:j.tosov...@email.cz] 
 Subject: Local VisualVM connection to Tomcat

 It is not needed if you are going to monitor it locally, using the
 same user that Tomcat runs with.

The key part of the above is same user.

 But there is no further description for that simpler (local) method. If it
 is obvious, sorry, but I am lost here ;-)

Usually, all you have to do is start jvisualvm.exe, and it will automatically 
find the all the Java processes currently running and show them in the left 
pane.  Unfortunately, on Windows, this doesn't always work when the one you're 
interested in is a service, even when that service is running under the same 
account as jvisualvm.  Whether or not it works seems to depend on the Windows 
version, applied patches, how much it's locked down, and who knows what else - 
another Microsoft mystery.  If you can run Tomcat from the startup.bat script, 
using VisualVM should be fine, and it may work with Tomcat as a service.

You do need to install the JConsole add-ins for VisualVM, or just use JConsole 
instead (all of the above comments relating to Windows service issues still 
apply).

 - 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: Local VisualVM connection to Tomcat

2013-06-27 Thread Mark Eggers

On 6/27/2013 1:31 PM, honyk wrote:

Dear All,

I am constantly encountering PermGen errors despite quite high
PermGen limit (even 512m) and many options set - approx once a week
under not heavy load.

I am trying to investigate what the app causes this, but I haven't
succeeded in reproducing it locally yet.

I found several articles about VisualVM (I hope it could help me to
determine some PermGen issues) and connecting it to the Tomcat.
Remotely. But I have no clue how can I conect the local VisualVM to
tomcat that runs on localhost.

Even here it is written:
http://tomcat.apache.org/tomcat-7.0-doc/monitoring.html

Enabling JMX Remote Note: This configuration is needed only if you
are going to monitor Tomcat remotely. It is not needed if you are
going to monitor it locally, using the same user that Tomcat runs
with.

But there is no further description for that simpler (local) method.
If it is obvious, sorry, but I am lost here ;-)

Thanks, Jan


It's actually very simple.

1. Start up Tomcat from startup.sh / startup.bat
2. Fire up visualvm
3. The Local node should have Tomcat visible
4. Double-click on the Tomcat element, and you're connected

Getting a first start on where your leaks are is pretty easy as well.

1. Load your web application
2. Run it to generate the leak
3. Unload it from Tomcat using the manager app (or any other method)
4. Do a Find Leaks from the manager app (or garbage collection from
   VisualVM)
5. Do a heap dump
6. In the classes, look for org.apache.catalina.loader.WebappClassLoader
7. Find the instance where the boolean started is false
8. Right-mouse on the instance and search for nearest GC Root
9. Find classes that you wrote and fix

This gets the classLoader leak . . . others can be found by looking for 
application - specific classes.


Hope this helps.

. . . just my two cents
/mde/



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



Re: Local VisualVM connection to Tomcat

2013-06-27 Thread Mark Thomas
On 27/06/2013 22:03, Mark Eggers wrote:
 Getting a first start on where your leaks are is pretty easy as well.
 
 1. Load your web application
 2. Run it to generate the leak
 3. Unload it from Tomcat using the manager app (or any other method)
 4. Do a Find Leaks from the manager app (or garbage collection from
VisualVM)
 5. Do a heap dump
 6. In the classes, look for org.apache.catalina.loader.WebappClassLoader
 7. Find the instance where the boolean started is false
 8. Right-mouse on the instance and search for nearest GC Root
 9. Find classes that you wrote and fix
 
 This gets the classLoader leak . . . others can be found by looking for
 application - specific classes.
 
 Hope this helps.

This might be useful:
http://people.apache.org/~markt/presentations/2010-11-04-Memory-Leaks-60mins.pdf

Mark


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



RE: Local VisualVM connection to Tomcat

2013-06-27 Thread honyk
On 2013-06-27 Christopher Schultz wrote:
 On 6/27/13 4:31 PM, honyk wrote:
  I am constantly encountering PermGen errors despite quite high
  PermGen limit (even 512m) and many options set - approx once a week
  under not heavy load.
 
 Like what kinds of options? What kind of load? What does the error
 look like? Are you re-deploying your webapp without restarting Tomcat,
 or do you bust PermGen even with a single deployment?

Tomcat runs as service using these Java opts (tomcat7w.exe) - single line

-Duser.language=en 
-XX:MaxPermSize=512m 
-XX:+DisableExplicitGC 
-XX:+CMSClassUnloadingEnabled 
-XX:+CMSPermGenSweepingEnabled

Originally I used Apache JkMount/Worker to hide that port number. In that case 
there were listed these errors in the tomcat err log:
Exception in thread ajp-bio-8009-exec-7 java.lang.OutOfMemoryError: PermGen 
space

Now I use proxypass like this (hoping this is preffered way):
ProxyPass /my-app ajp://localhost:8009/my-app

and in this case I can see just 
Exception in thread ajp-bio-8009-exec-4
without any details (but I suppose it is the same PermGen one)

I do not hot deploy my apps. They are JSF2.0/Mojarra powered, some of them 
access database a generate various reports.

 
  I am trying to investigate what the app causes this, but I haven't
  succeeded in reproducing it locally yet.
 
  I found several articles about VisualVM (I hope it could help me
  to determine some PermGen issues) and connecting it to the Tomcat.
  Remotely. But I have no clue how can I conect the local VisualVM to
  tomcat that runs on localhost.
 
  Even here it is written:
  http://tomcat.apache.org/tomcat-7.0-doc/monitoring.html
 
  Enabling JMX Remote Note: This configuration is needed only if you
  are going to monitor Tomcat remotely. It is not needed if you are
  going to monitor it locally, using the same user that Tomcat runs
  with.
 
  But there is no further description for that simpler (local)
  method. If it is obvious, sorry, but I am lost here ;-)
 
 Connecting to a Tomcat running on localhost is dead simple:
 
 1. Launch VisualVM
 2. Once the main screen loads, double-click on Tomcat from the
 Local cluster of applications
 3. Profit

Now I've found this interesting article:
https://blogs.oracle.com/nbprofiler/entry/monitoring_java_processes_running_as

I realized that my tomcat runs as a service but I am logged as an user and in 
this case the tomcat is not visible to me. I'll test it differently tomorrow.

Regards, Jan


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



RE: Local VisualVM connection to Tomcat

2013-06-27 Thread Caldarale, Charles R
 From: honyk [mailto:j.tosov...@email.cz] 
 Subject: RE: Local VisualVM connection to Tomcat

 Now I've found this interesting article:
 https://blogs.oracle.com/nbprofiler/entry/monitoring_java_processes_running_as

Note that the article is over four years old.  One of its key steps doesn't 
work with current versions of Windows:

Make sure the service is configured to run under Local System account with 
'Allow service to interact with desktop' option enabled.

The possibility of services interacting with the desktop disappeared some time 
ago.

 - 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