By default, the Java Agent detects code deadlocks. You can find deadlocks and see their details using the Events list or the REST API.
Code Deadlocks and Their Causes
In multi-threaded development environments, it is common to use more than a single lock. However, sometimes deadlocks will occur. Here are some possible causes:
- The order of the locks is not optimal
- The context in which they are being called (for example, from within a callback) is not correct
- Two threads may wait for each other to signal an event
Finding Deadlocks Using the Events List
Select Code Problems (or just Code Deadlock) in the Filter By Event Type list to see code deadlocks in the Events list. The following list shows two deadlocks in the ECommerce tier.
To examine a code deadlock, double-click the deadlock event in the events list and then click the Code Deadlock Summary tab. Details about the deadlock are in the Details tab. See Monitor Events.
Find Deadlocks Using the REST API
You can detect a DEADLOCK event-type using the AppDynamics REST API. For details, see the example Retrieve event data.