Filtering

jMechanic filtering support can be used to remove extraneous information from the CPU Snapshots and Heap Allocation Views.  By removing the extraneous information, you will be more able to find the code that is contributing to the performance of your application.  Select the Filter action on the CPU Snapshots or Heap Allocations view to select the filtering for the current snapshot in the view.

Filter Selection Dialog
(Click to enlarge)

Filter Selection Dialog Items

Enable Filtering

Use the Enable Filtering checkbox to enable or disable the filtering.

Add Type...

The Add Type... button allows a specific type to be selected for filtering.

Add Package...

The Add Package... button allows a package prefix to be selected for filtering.

Remove Components

The Remove Components button removes all selected filter components from the current filter.

Filter Processing

At the lowest level, filters are applied to individual stack frames in the captured data.  If all stack frames in a stack trace are excluded, then the stack trace is excluded along with the data attributed to that stack trace.  The filter components are applied in two passes:
  1. The type exclusions are applied in sorted order using an equality test for the fully-qualified class name in the stack frame.
  2. The package prefixes are applied in sorted order using a "starts with" test for the fully-qualified class name in the stack frame.
This implies a few things about choosing filter component values:

Notes: