Monitor and Analyze JVM Memory

Overview

This page explains how to monitor and analyze Java Virtual Machine (JVM) memory for applications running in Bloomreach Cloud.

When to Use

Use these procedures to:

  • Create and retrieve heap and thread dumps for JVM analysis.
  • Download and review garbage collection (GC) logs.
  • Configure alerts for OutOfMemoryError events.
  • Monitor JVM memory usage with New Relic.

Background

At the end of 2024 and into early 2025, Bloomreach Cloud will introduce an updated, backward-compatible heap dump implementation. This update allows multiple heap dumps with a 60-day retention period, compared to the previous limit of one heap dump at a time. This page describes the new functionality. For version-specific details, refer to the API documentation for your stack. Examples for the previous implementation are included at the end of this page.

Create and Retrieve Heap and Thread Dumps

Bloomreach Cloud provides API endpoints to create and retrieve heap and thread dumps. There are two types of heap dumps:

  • Heap dumps triggered manually through the API.
  • Heap dumps generated automatically by the JVM when an OutOfMemoryError occurs.

Thread dumps do not have this distinction.

Refer to the API documentation for instructions on creating and retrieving heap and thread dumps. Heap dumps are retained for 60 days and are deleted automatically after this period or when deleted manually.

In Mission Control, heap dumps appear in a dedicated tab for each environment. To trigger a manual heap dump for all pods, use the red plus icon at the bottom right of the screen. The "triggered-at" field records the timestamp of the manual heap dump, which helps identify related dumps.

Example: Download Heap Dump

To download a heap dump, run the following command. Replace <stackname>, <env-id>, <heapdump-id>, and <auth-token> with your values. The response provides a signed S3 URL for downloading the heap dump.

curl https://api.<stackname>.bloomreach.cloud/v3/environments/<env-id>/heapdump/<heapdump-id>/downloadlink \
  -H 'Authorization: Bearer <auth-token>'  

Example: Delete Heap Dump

First, retrieve the list of heap dumps using a GET request and select the appropriate heapdump-id.

To delete a heap dump (manual or OutOfMemoryError-generated), execute:

curl -X DELETE \ 
  https://api.<stackname>.bloomreach.cloud/v3/environments/<env-id>/heapdump/<heap-dump-id> \
  -H 'Authorization: Bearer <auth-token>'

If you omit the heapdump-id, the API deletes the oldest dump for backward compatibility.

Note: For complete details on creating and retrieving heap and thread dumps, see the API documentation.

Download GC Logs

You can download logs directly from Humio. In Mission Control, follow the "View the streaming logs" link. For detailed instructions, see Monitoring Application Logs using Humio.

Configure Humio to Send OutOfMemoryError Alerts

To receive alerts for OutOfMemoryError events, configure an alert in Humio:

  1. Use the search string *java.lang.OutOfMemoryError*.
  2. Set up an alert as described in the Humio Alerts documentation.
  3. Schedule the alert to run every 10 minutes for timely notifications. Running the alert more frequently may result in excessive notifications.

Monitor Memory with New Relic

Bloomreach Cloud integrates with New Relic for environment monitoring, including JVM memory metrics.

To download New Relic agent logs, go to the environment details page in Mission Control and use the "Download the log files for this environment" link.

API Examples: 2024 Implementation

Download Heap Dump

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

Delete Heap Dump

curl -X DELETE \ 
  https://api.<stackname>.bloomreach.cloud/v3/environments/<env-id>/heapdump/oomcreated \
  -H 'Authorization: Bearer <auth-token>'
Share Feedback
Page: /deploy/bloomreach-cloud/reference-documentation/monitor-and-analyze-jvm-memory
Section: Deploy
Category *
Monitor and Analyze JVM Memory | Bloomreach Content Documentation