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.

End of 2024 and early 2025 we roll out an improved, backward compatible implementation of heap dumps. This page describes the new functionality. See the API documentation of your stack for version specific details on how to create and retrieve heap & thread dumps. At the bottom of this page there is a section with examples based on the old implementation. The old implementation supported only one heap dump at a time. The new implementation supports unlimited heap dumps with a 60 day retention.

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 another created by the JVM when an out of memory exception occurs. For thread dumps there is no such distinction. See the API documentation on how to create and retrieve heap & thread dumps. Heap dumps are removed automatically after 60 days or when manually deleted.

Mission Control shows the heap dumps in a separate tab of the environment. Using the red plus icon at the right bottom of the screen will trigger a manual heap dump for all pods. The triggered-at field indicates the timestamp when the manual heap dump was triggered and is a mean to see which dumps belong together.

Example: Download Heap Dump

To download a heap dump, execute the following command, replacing <stackname>, <env-id>, <heapdump-id> and <auth-token> with the appropriate values. This will return a signed s3 url that you can use to download 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 heap dumps with a GET operation and select the right heapdump-id.

To delete a heap dump created either manually or by the JVM due to an OOME, execute the following command, replacing variables with the appropriate values:

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

For backward compatibility reasons the heapdump-id is optional when deleting (heap) dumps. In this case the oldest dump is deleted. 

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.

API examples based on the 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>'

 

 

 

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?