Am 05.06.19 um 22:13 schrieb Eugène Adell: > Hello, > > if I may suggest something, over the years I have found very useful > jstat and GCViewer for detecting GC suspicious behaviors. Both are of > course free, the first one giving information on a live JVM, and the > second being more interesting for an offline analysis (though it can > be updated automatically). With that you can see an OOM coming, and > you also can have some clues for the heap settings if you want to tune > them. You also have a visual proof when you perform a major upgrade > and want to see if it had an impact on memory, by comparing 2 or 3 > pictures before with 2 or 3 pictures after. They were not very often > mentionned in the users list, maybe they are underrated ?
I like gc logs a lot, as they give me a quick picture of the used memory. I have configured all my tomcat instances to log there gc's. And my first go to when an instance feels slow is to use jstack and look at the fgc count. So feel free to add a paragraph about using gc logs and corresponding tools to the wiki. Felix > > best regards > E.A. > > Le mar. 4 juin 2019 à 21:00, Felix Schumacher (Confluence) > <no-re...@apache.org <mailto:no-re...@apache.org>> a écrit : > > There's *1 new edit* on this page > > page icon > > <https://cwiki.apache.org/confluence/display/TOMCAT/Troubleshooting+and+Diagnostics?src=mail&src.mail.product=confluence-server&src.mail.timestamp=1559674809846&src.mail.notification=com.atlassian.confluence.plugins.confluence-notifications-batch-plugin%3Abatching-notification&src.mail.recipient=8aa9809569d423cd016a0413306f00db&src.mail.action=view> > > > Troubleshooting and Diagnostics > > <https://cwiki.apache.org/confluence/display/TOMCAT/Troubleshooting+and+Diagnostics?src=mail&src.mail.product=confluence-server&src.mail.timestamp=1559674809846&src.mail.notification=com.atlassian.confluence.plugins.confluence-notifications-batch-plugin%3Abatching-notification&src.mail.recipient=8aa9809569d423cd016a0413306f00db&src.mail.action=view> > > > > Felix Schumacher edited this page > > > > > Here's what changed: > > ... > > * How To: Capture a thread dump > > <https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=103099265> > > * How To: Capture a heap dump > > <https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=103099265> > > * How To: Examine a Stacktrace > > <https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=103099265> > > * How To: Configure Tomcat for debugging > > <https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=103099265> > > * FAQ: Developing > > <https://cwiki.apache.org/null/pages/createpage.action?spaceKey=TOMCAT&title=FAQ%2FDeveloping&linkCreation=true&fromPageId=103099080> > > * FAQ: Memory > > <https://cwiki.apache.org/null/pages/createpage.action?spaceKey=TOMCAT&title=FAQ%2FMemory&linkCreation=true&fromPageId=103099080> > > * Tomcat Memory Leak Protection > > <https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=103099526> > > * Sun Technical Article: Monitoring and Managing Java SE 6 > Platform Applications > <http://java.sun.com/developer/technicalArticles/J2SE/monitoring/> > > * Notes on using JMX clients > > <https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=103099080> > > > ... > > * jinfo - Prints JVM process info > > <http://download.oracle.com/javase/6/docs/technotes/tools/share/jinfo.html> > > * jstack - Prints thread stack traces > > <http://download.oracle.com/javase/6/docs/technotes/tools/share/jstack.html> > > * jmap - Dumps heap and shows heap status > > <http://download.oracle.com/javase/6/docs/technotes/tools/share/jmap.html> > > * jhat - Heap Analyzer Tool > > <http://download.oracle.com/javase/6/docs/technotes/tools/share/jhat.html> > > * jcmd - Multitool intended to replace the above JDK tools > > <https://docs.oracle.com/javase/8/docs/technotes/tools/windows/jcmd.html> > > > > Profilers & Heap Analyzers > > * Eclipse Memory Analyzer (MAT) <http://www.eclipse.org/mat/> > * YourKit Profiler <http://www.yourkit.com/> > * > > VisualVM Docs > > <http://download.oracle.com/javase/6/docs/technotes/tools/share/jvisualvm.html> > > > > Anchor > > usingjmxclients > > usingjmxclients > > ... > > 1. Look into Tomcat access log > > <https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=103099265> > (the log file generated by AccessLogValve > > <https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=103098448>). > > * If your request is not listed there, then it has not been > processed by Tomcat. You need to look elsewhere (e.g. at > your firewall). > * You will see what IP address your client is using, and > whether it is using an IPv4 (|127.0.0.1|) or IPv6 address > (|0:0:0:0:0:0:0:1|). Modern operating systems can use IPv6 > addresses for localhost / local network access, while > external network is still using IPv4. > 2. Take a thread dump > > <https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=103099265>. > This way you will find out what Tomcat is actually doing. > * If you are troubleshooting some process that takes > noticeable time, take several (three) thread dumps with > some interval between them. This way you will see if there > are any changes, any progress. > 3. Try debugging > > <https://cwiki.apache.org/null/pages/createpage.action?spaceKey=TOMCAT&title=FAQ%2FDeveloping&linkCreation=true&fromPageId=103099080>. > * A good place for a breakpoint is > |org.apache.catalina.connector.CoyoteAdapter.service()| > method. That is the entry point from Tomcat connectors and > into the Servlet engine. At that place your request has > already been received and its processing starts. > > ... > > The main suspect is *your own web application* keeping a reference > to Request / Response objects outside of their life cycle. > > The lifetime of the Response object is documented in the Servlet > specification > > <https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=103100166>. > Quoting from section "5.8 Lifetime of the Response Object" of > Servlet 4.0 specification: > > "Each response object is valid only within the scope of a > servlet’s service method, or within the scope of a filter’s > doFilter method, unless the associated request object has > asynchronous processing enabled for the component. If asynchronous > processing on the associated request is started, then the response > object remains valid until complete method on AsyncContext is > called." > > In case of asynchronous processing, when an error occurs Tomcat > notifies all registered |AsyncListener}}s and then calls > {{complete()| automatically if none of the listeners have called > it yet. (Reference: 61768 > <https://bz.apache.org/bugzilla/show_bug.cgi?id=61768#c3>) > > Also see sections "2.3.3.4 Thread Safety" and "3.13 Lifetime of > the Request Object" of the same specification. > > > To troubleshoot the issue: > > ... > > You can also search the archives of the Tomcat users' mailing > lists <http://tomcat.apache.org/lists.html> for previous > discussions mentioning the |RECYCLE_FACADES| flag. > 2. Read about Java ImageIO > > <https://cwiki.apache.org/null/pages/createpage.action?spaceKey=TOMCAT&title=FAQ%2FKnownIssues&linkCreation=true&fromPageId=103099080>issue. > > Accessing response objects after their lifetime can lead to > security issues in your application, such as sending responses to > wrong clients, mixing up responses. If you can reproduce the issue > and the above diagnostic does not show your own bug, but a bug in > Apache Tomcat, > > ... > > Go to page history > > <https://cwiki.apache.org/confluence/pages/viewpreviousversions.action?pageId=103099080&src=mail&src.mail.product=confluence-server&src.mail.timestamp=1559674809846&src.mail.notification=com.atlassian.confluence.plugins.confluence-notifications-batch-plugin%3Abatching-notification&src.mail.recipient=8aa9809569d423cd016a0413306f00db> > > > > View page > > <https://cwiki.apache.org/confluence/display/TOMCAT/Troubleshooting+and+Diagnostics?src=mail&src.mail.product=confluence-server&src.mail.timestamp=1559674809846&src.mail.notification=com.atlassian.confluence.plugins.confluence-notifications-batch-plugin%3Abatching-notification&src.mail.recipient=8aa9809569d423cd016a0413306f00db&src.mail.action=view> > > > > > Stop watching space > > <https://cwiki.apache.org/confluence/users/removespacenotification.action?spaceKey=TOMCAT&src=mail&src.mail.product=confluence-server&src.mail.timestamp=1559674809846&src.mail.notification=com.atlassian.confluence.plugins.confluence-notifications-batch-plugin%3Abatching-notification&src.mail.recipient=8aa9809569d423cd016a0413306f00db&src.mail.action=stop-watching&jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ4c3JmOjhhYTk4MDk1NjlkNDIzY2QwMTZhMDQxMzMwNmYwMGRiIiwicXNoIjoiY2U1MGZlMTc3OWE4OWIzOWJmMjgzOGRhYWMzZjZhZmU0MjI1YmRkOTc1ZThiYTBlZDk3Y2E0MWYwNmYwNTJlYyIsImlzcyI6ImNvbmZsdWVuY2Vfbm90aWZpY2F0aW9uc0FSRUgtWFVEMS1QT1FHLUNTQU8iLCJleHAiOjE1NjAyNzk2MDksImlhdCI6MTU1OTY3NDgwOX0.TQ4zj3GVLlMr-fdYhyjnhF3tYLCvOk8dioKAeVb4UoQ> > • > > Manage notifications > > <https://cwiki.apache.org/confluence/users/editmyemailsettings.action?src=mail&src.mail.product=confluence-server&src.mail.timestamp=1559674809846&src.mail.notification=com.atlassian.confluence.plugins.confluence-notifications-batch-plugin%3Abatching-notification&src.mail.recipient=8aa9809569d423cd016a0413306f00db&src.mail.action=manage> > > > > Confluence logo big > > This message was sent by Atlassian Confluence 6.15.2 > >