Debug java application

less than 1 minute read

Just use this post to write down some techniques about debugging java applications, especially for multi-thread, deadlock or memory issues.

For IBM JDK, use the following command to trigger thread dump.

kill -3 pid

For Open JDK


Tools for debugging http services

  • http toolkit
    • Intercept & view all your HTTP(S)
    • Mock endpoints or entire servers
    • Rewrite, redirect, or inject errors

State of Java threads

There will be a lot of threads that will be irrelevant in 90% of cases. Focus on the threads where your application work occurs, such as the WebContainer thread pool. In this example, all of the threads are waiting for work (either parked in the WAS BoundedBuffer or in IBM AIO code waiting for the next event). Remember that only the full stack is meaningful. In some cases, a parked thread, or a thread waiting in Object.wait may be a problem, so it’s best to look methodically through the stacks.