Monitor and Analyze JVM Memory

Introduction

Goal

Monitor and analyze JVM memory for your applications running in Bloomreach Cloud.

Background

This page provides useful information about how to monitor and analyze the JVM memory of your applications running in Bloomreach Cloud.

Create and Retrieve Heap and Thread Dumps

The Bloomreach Cloud API supports creating and retrieving heap and thread dumps. There are two types of heap dumps: one created by the JVM triggered through the API and one created by the JVM when an out of memory exception occurs. For thread dumps there is no such distinction.

To keep resource allocation small, the API allows for one heap and thread dump created at a time. Since the JDK will not overwrite an automatically created existing heap dump, it is important to delete the heap dump after downloading, so the JDK can create a new one when an out of memory exception occurs.

Example: Download Heap Dump

To download a heap dump created by the JVM due to an OOME, execute the following command, replacing <stackname>, <env-id>, and <auth-token> with the appropriate values:

curl -X GET \
  https://api.<stackname>.bloomreach.cloud/v3/environments/<env-id>/heapdump/oomcreated \
  -H 'Accept-Encoding: gzip' \
  -H 'Authorization: Bearer <auth-token>' \
  -H 'cache-control: no-cache' \
  -d '{
  "fileId": ""
}' \
-o heapdump.hprof

Example: Delete Heap Dump

To delete a heap dump created by the JVM due to an OOME, execute the following command, replacing <stackname>, <env-id>, and <auth-token> with the appropriate values:

curl -X DELETE \ 
  https://api.<stackname>.bloomreach.cloud/v3/environments/<env-id>/heapdump/oomcreated \
  -H 'Authorization: Bearer <auth-token>'
See the API documentation for full details on how to create and retrieve heap & thread dumps.

Download GC Logs

You can access and download logs directly from Humio by following the View the streaming logs link in Mission Control. For more information, please refer to Monitoring Application Logs using Humio.

Configure Humio to Send OutOfMemoryError Alerts

You can define alerts in Humio for OutOfMemoryError. Enter as search string "*java.lang.OutOfMemoryError*" and define an alert as described on Humio Alerts. Let the alert run every ~10 minutes for quick feedback. If you run the alert too often, you might be flooded with notifications.

Use New Relic to Monitor Memory

Bloomreach Cloud supports New Relic for environment monitoring, including monitoring of JVM memory.

Newrelic agent logs can be downloaded in Mission Control from the environment details page using the Download the log files for this environment link.

Did you find this page helpful?
How could this documentation serve you better?
On this page
    Did you find this page helpful?
    How could this documentation serve you better?