In java, i have 2 threads started at the same time. However, i noticed the thread 2 is being blocked but i do not know where. Is there a way in java to find out where a thread has been blocked/waiting? thank u.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You could use
jstackto get the stack traces for all threads. That’ll tell you where exactly in the code your thread is blocked.To get a more detailed picture of what’s happening inside your process, you could use
VisualVM.