I have always neglected to write down java tools and commands that I use for troubleshooting. I will try to put in on this page.

Memory and Threads

There are many tools to measure java memory. In my experience, the easiest way to troubleshoot locally is to hook your development environment up to VisualVM. There are even plugins for it in e.g. IntelliJ. It is probably possible to do this to a production server as well, but that would likely impact performance. If you have access to the server, and have nothing prepared, you can do a heap-dump, which you can copy over and analyze in your local VisualVM. Taking heap dumps is done by jcmd 1 GC.heap_dump /tmp/dump.hprof.

CPU

Just use new relic

Database

Just use new relic