Out of memory errors

What is an out of memory error?

Out of Memory errors in Java and .NET occur when the VM/CLR cannot create a requested object because it cannot allocate any more memory. This can happen for several reasons:

  • Memory Leak
  • Insufficient memory configuration for the JVM.
  • Single transactions need too much memory so parallel running transactions do not have enough.

Goal of this tutorial

To explain how AppMon handles out of memory errors, and how to respond.

Scenario

The easyTravel application is running and has run out of memory. AppMon capture these events by raising incidents.

Requirements

Procedure

You need the Large Memory Leak easyTravel problem pattern. Run any scenario, then click Problem Patterns tab, and select Large Memory Leak. Let it go for some time, to allow AppMon to gather some data.

Detect the out of memory error

Every System Profile contains built-in incident rule Application Process Out-of-Memory. It triggers on out of memory error from the application. It also automatically creates a leak analysis memory snapshot, unless it's deactivated in the Agent Group - Agent Mapping Advanced Settings.

Open the [Incidents dashlet]({% link_to_id %}). Here you can find out of memory incidents. Right-click one, and select Open memory dump, to show the related leak analysis memory snapshot in the Total Memory dashlet.

Incident dashlet
Incident dashlet

In the Total Memory dashlet, click Post-process.

Total Memory dashlet
Total Memory dashlet

From here, you can start analysis of the snapshot, to identify the source of the leak. See Memory Analysis tutorial and Memory Diagnostics for more info on it.

You can also create custom incidents to trigger a memory snapshot, when memory consumption exceeds a certain threshold. See Memory diagnostics - Incident based to learn how.