The Diagnostic Tools Advanced Settings screen is used to configure additional global settings for all diagnostic tools. This centralized interface focuses on key areas such as memory management, profiling, stack tracing, and mutex lock profiling, enabling administrators to optimize resource usage, identify performance bottlenecks, and improve system stability. While these settings are optional, they offer additional options for better performance, all conveniently configured on a single screen.

## Global Configuration

- Diagnostic Tools Directory
  - Specifies the directories where diagnostic data (e.g., thread dumps, heap dumps, TCP dumps, Java Flight Recorder files) will be stored.
  - Separate directories can be configured for Linux (/tmp/) and Windows (C:\Windows\Temp\) environments.

## Heap Dump

- Minimum Free Heap Memory Percentage:
  - Defines the threshold percentage of free heap memory required on the target server to trigger a heap dump. In the image, the threshold is set to 5%.
  - A heap dump is automatically triggered when free memory falls below this percentage, providing data to identify memory leaks or inefficient usage.

## Memory Profiling

- Limit Profiling Activity:
  - Restricts the profiling activity to a certain percentage of the profiling duration. This minimizes overhead and avoids significant performance degradation while capturing memory usage details.
  - In the current setting, profiling is limited to 20% of the duration.

## Stack Trace Settings

- Count of Unique Stack Traces to Capture:
  - Specifies the number of unique stack traces the system should capture, helping to identify repeated code execution patterns or issues.
  - In this example, 1000 stack traces will be captured.
- Number of Top Stack Trace Lines for Uniqueness:
  - Determines the number of lines from the top of the stack trace used to identify uniqueness, ensuring efficient grouping of similar traces.
  - The setting here uses the top 50 lines.
- Include/Exclude Classes:
  - Allows you to refine stack trace capture by including specific classes (e.g., classA, classB) or excluding others. This feature helps focus diagnostics on critical areas of the application.

## Mutex Lock Profiling

- Max Profiled Thread Count:
  - Specifies the maximum number of threads to profile for mutex locks (e.g., locks that synchronize access to resources). Here, it's set to 1000.
- Max Profiled Stack Trace Count:
  - Limits the number of stack traces captured for mutex lock profiling to avoid excessive data. In this case, the limit is also 1000.
- Limit Profiling Activity:
  - Restricts the profiling activity to a specific percentage of the profiling duration, helping to manage overhead. The current setting is 20%.

### Note :

- Configure Diagnostic Directories: Ensure the correct paths for storing diagnostic data for Linux and Windows environments to facilitate easy retrieval and analysis.
- Heap Dump Management: Set appropriate memory thresholds to trigger dumps only when necessary, avoiding unnecessary storage consumption.
- Optimize Memory Profiling: Limit profiling activity to reduce overhead and maintain application performance during diagnostics.
- Focus Stack Tracing: Use include/exclude class filters and unique stack trace thresholds to capture only the most relevant data.
- Mutex Lock Profiling: Set realistic limits for thread and stack trace profiling to identify lock contention without overloading system resources.