## Trigger Event Types |

The following trigger types are available in the trigger wizard for configuring triggers:

- Method invocation

  Symbol:

  This event occurs when a method is called. Several methods can be configured for the same action sequence. Besides the standard actions, there are several special actions for this trigger type.

  The second step of the trigger wizard will then be the "Specify methods" step. Here you can edit the list of methods for which this trigger will be activated. There are several ways to enter new methods:

  - Search in configured classpath
    A class chooser will be shown that shows all classes in the classpath configured in the application settings. Finally you have to select a method from the selected class.
  - Search in other JAR or class files
    First, you can select a JAR or class file. If the selection is a JRE file, you then have to select a class in a class chooser. After the selection you will be asked whether to expand the classpath with the current selection. For remote sessions, the classpath is often not configured, so this is a shortcut to make your selection permanent. Finally you have to select a method from the selected class.
  - Search in profiled classes
    If the session is being profiled, a class chooser is displayed that shows all classes in the profiled JVM. There may be classes in the classpath that have not been loaded. Those classes will not be shown in the class chooser. Finally you have to select a method from the selected class.
  - Enter manually (advanced)
    This option displays a dialog that allows you to enter class name, method name and method signature in JNI format. The JNI format of the method signature is explained in the javadoc of `com.jprofiler.api.agent.interceptor.InterceptionMethod`.

    The context menu offers the option to edit existing entries in this dialog.

  In addition, all views with call trees offer the possibility to select methods for a method trigger in the context menu.

  By default, the method trigger event is not fired for recursive calls. This means that if a method M is being called and later on in the call stack method M is called again, the event is only fired for the first invocation of method M. If you deselect the check box `Ignore recursive calls`, the event will be fired for all invocations of a method.

- Heap usage threshold

  Symbol:

  Requirements: Java 1.4+

  This event occurs when the heap usage exceeds a certain threshold in percent of the maximum heap size for a minimum period of time.

  The second step of the trigger wizard will then be the "Threshold" step. Here you can configure the

  - Threshold
    The trigger will be activated each time when the used heap size exceed the configured percentage of the maximum heap size.
  - Activation time
    To avoid spurious trigger events, the activation time sets a minimum amount of time during which the threshold must be exceeded. Only after the activation time has passed will the trigger be activated.
  - Deactivation time
    Similar to the activation time, the trigger will only be deactivated after heap usage falls below the threshold for a minimum amount of time. By default, the deactivation time is the same as the activation time, however, you can configure a different time for it. Activation and deactivation times determine the sensitivity of the trigger to the threshold value.
  - Inhibition time
    To avoid that too many trigger events are fired, you can set an inhibition time. After the trigger has been deactivated, the trigger will not be activated again for the duration of the inhibition time.
- CPU load threshold

  Symbol:

  Requirements: Java 1.5+

  This event occurs when the CPU load exceeds a certain threshold in percent for a minimum period of time.

  The second step of the trigger wizard will then be the "Threshold" step which is explained above for the "Heap usage threshold" trigger with the only difference that the threshold value is the CPU load in percent.

- Out of memory exception

  Symbol:

  Requirements: Java 1.6+

  This event occurs when an OutOfMemoryException is thrown. You can only save an HPROF snapshot in this case since the trigger works by adding -XX:+HeapDumpOnOutOfMemoryError to the VM options. Also, this trigger only works with a Java 6+ JVM. For 1.5.0_07+ and 1.4.2_12+, this VM option is also supported, however, it cannot be added by the profiling agent, so you have to add it manually to the VM options of the profiled application.

- Timer

  Symbol:

  With a timer trigger, you can periodically execute a certain set of actions, such as saving a snapshot.

  The second step of the trigger wizard will then be the "Timer" step where you can configure the following properties of the timer:

  - Timer type
    A timer can either periodically either and unlimited number of times of a limited number of times.
  - Interval
    The interval defines the period of time between two subsequent timer invocations.
  - Offset
    With the offset, you can specify how much time should pass between the start of the JVM and the first invocation of the timer.
- JVM startup

  Symbol:

  With a JVM startup trigger, you can execute a certain set of actions right after the JVM is started for profiling. The actual execution is performed right after the trigger subsystem has been initialized in the profiling agent.

- JVM exit

  Symbol:

  With a JVM exit trigger, you can execute a certain set of actions right before the JVM is shut down. This is implemented with a standard shutdown hook, so code in other shutdown hooks may be executed after the associated actions.