Memory diagnostics - Production

If you cannot suspend your application, for example if the application is running in a production environment, AppMon provides the means for trending snapshots and selective memory snapshots. Trending snapshots do not contain every instance or references between instances. However, they provide an overview of which instances are growing. You can use this information in conjunction with selective memory snapshots to find where in an application the instances of a growing class are allocated.

Diagnosis process in production environments
Diagnosis process in production environments

You can use trending memory snapshots to determine which classes are top-most instantiated and compare them in the Memory Comparison dashlet among multiple snapshots created over time. Here you can define Memory Sensor Rules for growing classes, and use them to create selective memory snapshots.

Selective memory snapshots track the instantiation of selected classes defined by Memory Sensor rules. They identify the point in the code where instances are allocated. They do not stall the VM or CLR while they are created. However, they introduce some overhead for heap memory and CPU usage, especially when many instances are generated. See Selective Memory dashlet for details regarding selective memory snapshots.

General steps are:

  1. Create trending memory snapshots. You can use one of the following ways:


    AppMon persists all memory dumps onto the hard disk of the AppMon Server. This can fill up the disk, especially when creating scheduled dumps of larger VMs or CLRs. Unless suppressed by clearing the options in the Create Memory Snapshot dialog box, garbage collection is forced before a memory dump to prevent including already unreferenced objects and to provide better accuracy. Trending snapshots are, however, quite small. One snapshot requires approximately 1‐2 MB per on disk.

  2. In the Total Memory dashlet, select the snapshots, right-click, and select Compare.

  3. In the Memory Comparison dashlet, you can find the classes where the number of instances or their sizes are growing.

  4. Create and deploy Memory Sensor Rules for these classes:

    1. Right-click the required classes and select Create Memory Sensor Rule > Include in Memory Sensor Rule.
    2. The new sensor group is created, and shown in Sensors item of the System Profile Preferences dialog box.
    3. Give the group a meaningful name. Click Edit group icon, and specify the name.
    4. Make sure that the Place property is set to include.
    5. Click OK to save the newly created group.
    6. Open the System Profile Preferences dialog box, and select the Sensor item.
    7. Expand the Agent group, monitoring the app under investigation, and select the Sensor placement item.
    8. Place the newly created sensor pack. If Hot Sensor Placement is not available, restart your application.
  5. In the Selective Memory dashlet create memory snapshot with the required Agent.