The mutex lock profiling refers to the process of analyzing and measuring the performance and behavior of mutex lock in a program. The lock profiling enables you to understand the lock contention and blocking thread behavior of your application over time. In mutex lock profiling window, you can see the following details which are listed below:

- Mutex Lock Profiling Sessions
- Session Details
- Top Blocking Locks
- Top Blocked Threads
- Top Blocking Threads

## Pre-requisite

For mutex functionality to work correctly, the application must include the native agent argument. Ensure the following argument is added to the application startup configuration: -agentpath:/home/cavisson/netdiagnostics/lib/libjavanativeagent.so=feature_all.

## Mutex Lock Profiling Sessions

In mutex lock profiling session, you can see the details for the sessions which are related to a particular mutex lock profile. In mutex lock profiling session, you can see the following details related to the session which are listed below:

- Name: This shows the session name.
- Tier: This shows the tier name.
- Start Time: This will show the start time for the test.
- Duration: This will show the total duration of the test run.
- Description: This will show the session description.
- Session Details: This will show the details for the session such as: Session Name, Tier Name, Server Name and Instance Name.

Note: You can also delete an existing memory profiling session by clicking on the Delete icon.

## Top Blocking Locks

In top blocking locks, you can see the top locks in a system that are causing the highest level of contention or blocking among threads or processes. In top blocking locks, you can see the details for the following which are listed below:

- Class Data
- Statistics

Note: In the top blocking locks, you can see the list of top 10 blocking locks in the system.

### Class Data

In class data, you can see the details for top blocking locks in tabular format. There are following fields which are listed below:

- Name: It is the name of the blocking locks.
- Count: It is the count for the total top blocking locks.
- Block Time (Sec): It is the total time duration for which the thread was in blocked state.
- Wait Time (Sec): It is the total time duration for which the thread was in wait state.

#### Stack Trace

A stack trace will capture the total stack trace during the session. The default value for stack trace is 1000, default minimum value for stack trace is 100 and default maximum value for stack trace is 10000. In stack trace window, you can see the following details which are listed below:

- Stack Trace: In this, you can see the full stack trace for the selected class.
- Count: In this, you can see the count for the total created objects.

Note: You can also perform the following operations in the stack trace window which are listed below:

- You can copy the stack trace. To perform this operation, you have to click on the Copy button.
- You can also search a stack trace by the name of the stack trace in the Search

### Statistics

In statistics, you can see the following details which are listed below:

- Tier: It shows the name for the blocked tier.
- Server: It shows the name for the blocked server.
- Instance: It shows the name for the blocked instance.
- Duration: It shows the total time for which the thread was blocked.
- Overall Wait Time: It shows the overall wait time of the thread.
- Overall Block Time: It shows the overall blocked time of the thread.

In statistics, you can see the data in the following two graphical formats which are listed below:

- Pie
- Chart

You can also see three different types of statistical data in the pie or chart format which you can see in the total allocation which are listed below:

- Total Count
- Total Wait Time
- Total Blocked Time

Notes:

- You can also perform some additional actions in the statistics window by clicking on the Chart Context Menu icon.
- Once you click on the chart context menu, you can see the following options in the drop-down which are listed below:

1. View in Full Screen
2. Print Chart
3. Download PNG Image
4. Download JPEG Image
5. Download PDF Document
6. Download SVG Vector Image

### Lock Frequency Analysis

In lock frequency analysis, you can see the mutex lock analysis in the graphical format i.e.: the data will be represented in the graphical format.

## Top Blocked Threads

In top blocked threads, you can see the thread in a system that are experiencing the highest level of blocking or contention. These threads are identified on the basis of the amount of time spent waiting for locks, resources or other synchronization primitives. In top blocked threads, you can see the details for the following which are listed below:

- Class Data
- Statistics

Note: In the top blocked threads, you can see the list of top 10 blocked threads in the system.

### Class Data

In class data, you can see the details for top blocked threads in tabular format. There are following fields which are listed below:

- Name: It is the name of the blocked threads.
- Count: It is the count for the total top blocked threads.
- Block Time (Sec): It is the total time duration for which the thread was in blocked state.
- Wait Time (Sec): It is the total time duration for which the thread was in wait state.

### Stack Trace

A stack trace will capture the total stack trace during the session. The default value for stack trace is 1000, default minimum value for stack trace is 100 and default maximum value for stack trace is 10000. In stack trace window, you can see the following details which are listed below:

- Stack Trace: In this, you can see the full stack trace for the selected class.
- Count: In this, you can see the count for the total created objects.

Note: You can also perform the following operations in the stack trace window which are listed below:

- You can copy the stack trace. To perform this operation, you have to click on the Copy button.
- You can also search a stack trace by the name of the stack trace in the Search

### Statistics

In statistics, you can see the following details which are listed below:

- Tier: It shows the name for the blocked tier.
- Server: It shows the name for the blocked server.
- Instance: It shows the name for the blocked instance.
- Duration: It shows the total time for which the thread was blocked.
- Overall Wait Time: It shows the overall wait time of the thread.
- Overall Block Time: It shows the overall blocked time of the thread.

In statistics, you can see the data in the following two graphical formats which are listed below:

- Pie
- Chart

You can also see three different types of statistical data in the pie or chart format which you can see in the total allocation which are listed below:

- Total Count
- Total Wait Time
- Total Block Time

Notes:

- You can also perform some additional actions in the statistics window by clicking on the Chart Context Menu icon.
- Once you click on the chart context menu, you can see the following options in the drop-down which are listed below:

1. View in Full Screen
2. Print Chart
3. Download PNG Image
4. Download JPEG Image
5. Download PDF Document
6. Download SVG Vector Image

## Top Blocking Threads

In top blocking threads, you can see the threads which are in a blocked or waiting state due to a certain condition or synchronization primitives in a multi-threaded or concurrent program. When a thread encounters a blocking operation, it pauses its execution and waits until a specific condition is satisfied or a resource becomes available. In top blocking threads, you can see the details for the following which are listed below:

- Thread Data
- Statistics

Note: In the top blocking threads, you can see the list of top 10 blocking threads in the system.

### Thread Data

In thread data, you can see the details for top blocking threads in tabular format. There are following fields which are listed below:

- Name: It is the name of the blocked thread.
- Blocking Time: It is the total time duration for which the thread is in blocking state.
- Blocking Count: It is the total number of count for which the 1 thread was in blocking state.
- Blocked Thread Count: It is the total number of count for which a thread was in blocked state.

### Stack Trace

A stack trace will capture the total stack trace during the session. The default value for stack trace is 1000, default minimum value for stack trace is 100 and default maximum value for stack trace is 10000. In stack trace window, you can see the following details which are listed below:

- Stack Trace: In this, you can see the full stack trace for the selected class.
- Count: In this, you can see the count for the total created objects.

Note: You can also perform the following operations in the stack trace window which are listed below:

- You can copy the stack trace. To perform this operation, you have to click on the Copy button.
- You can also search a stack trace by the name of the stack trace in the Search

### Statistics

In statistics, you can see the following details which are listed below:

- Tier: It shows the name for the blocked tier.
- Server: It shows the name for the blocked server.
- Instance: It shows the name for the blocked instance.
- Duration: It shows the total time for which the thread was blocked.
- Overall Wait Time: It shows the overall wait time of the thread.
- Overall Block Time: It shows the overall blocked time of the thread.

In statistics, you can see the data in the following two graphical formats which are listed below:

- Pie
- Chart

You can also see three different types of statistical data in the pie or chart format which you can see in the total allocation which are listed below:

- Total Count
- Total Wait Time
- Total Block Time

Notes:

- You can also perform some additional actions in the statistics window by clicking on the Chart Context Menu icon.
- Once you click on the chart context menu, you can see the following options in the drop-down which are listed below:

1. View in Full Screen
2. Print Chart
3. Download PNG Image
4. Download JPEG Image
5. Download PDF Document
6. Download SVG Vector Image