Docs » Get started with the Splunk Distribution of the OpenTelemetry Collector » Collector components » Collector components: Extensions » Memory Ballast extension (deprecated)

Memory Ballast extension (deprecated) 🔗

Caution

The memory_ballast extension is deprecated and has been removed starting in Collector version 0.97.0. If you’re using this extension, read on to learn how to update your configuration.

memory_ballast is no longer effective. You can now control garbage collection with a soft memory limit using the SPLUNK_MEMORY_TOTAL_MIB env var, which is set to 90% of the total memory by default. For more information, see Environment variables.

Follow these steps to ensure your Collector instances work correctly:

  • If you haven’t customized memory_ballast, remove it from the configuration.

  • If you have customized memory_ballast using SPLUNK_BALLAST_SIZE_MIB (or extensions::memory_ballast::size_mib config), remove the memory_ballast extension and use the GOMEMLIMIT environment variable to set a custom soft memory limit:

    • To increase frequency of garbage collection set GOMEMLIMIT to a higher value than the default 90% of total memory.

    • To decrease frequency of garbage collection set GOMEMLIMIT to a lower value than the default 90% of total memory.

    • For more information, see Go environment variables .

Get started 🔗

The Memory Ballast extension enables applications to configure memory ballast for processing.

Follow these steps to configure and activate the component:

  1. Deploy the Splunk Distribution of OpenTelemetry Collector to your host or container platform:

  1. Configure the extension as described in the next section.

  2. Restart the Collector.

Sample configuration 🔗

To activate the component, add memory_ballast to the extensions section of your configuration file:

extensions:
  memory_ballast:

To complete the configuration, include the extension in the service section of your configuration file:

service:
  extensions: [memory_ballast]

You can configure the following settings for the extension:

  • size_mib. The memory ballast size, in MiB.

    • 0 by default.

    • Takes higher priority than size_in_percentage if both are specified at the same time.

  • size_in_percentage. Sets the memory ballast based on the total memory in percentage.

    • 0 by default.

    • The value can range from 1 to 100.

    • Supported in both containerized (Docker, Kubernetes) and physical host environments.

Configuration examples 🔗

This configuration uses 64 Mib of memory for the ballast:

extensions:
  memory_ballast:
    size_mib: 64

This configuration uses 20% of the total memory for the ballast:

extensions:
  memory_ballast:
    size_in_percentage: 20

Calculate the ballast’s size as a percentage 🔗

When size_in_percentage is enabled, the value for ballast_size is calculated as follows.

On the target host or container, check the value in memory.limit_in_bytes to learn if there’s any memory limitation for the running Collector process. Memory files are stores in paths such as /sys/fs/cgroup/memory/memory.limit_in_bytes.

  • If memory.limit_in_bytes is a positive value other than 9223372036854771712 (0x7FFFFFFFFFFFF000), the value for ballast_size is calculated with the formula

    ballast_size = size_in_percentage * memory.limit_in_bytes / 100

  • If memory.limit_in_bytes is 9223372036854771712 (0x7FFFFFFFFFFFF000), no memory limit has been set for the Collector process or the running container in cgroup, and the value for ballast_size is calculated with the formula

    ballast_size = size_in_percentage * totalMemory / 100

    where totalMemory is calculated by github.com/shirou/gopsutil/v3/mem on mem.VirtualMemory().total.

Settings 🔗

The following table shows the configuration options for the Memory Ballast extension:

Troubleshooting 🔗

If you are a Splunk Observability Cloud customer and are not able to see your data in Splunk Observability Cloud, you can get help in the following ways.

Available to Splunk Observability Cloud customers

Available to prospective customers and free trial users

  • Ask a question and get answers through community support at Splunk Answers .

  • Join the Splunk #observability user group Slack channel to communicate with customers, partners, and Splunk employees worldwide. To join, see Chat groups in the Get Started with Splunk Community manual.

To learn about even more support options, see Splunk Customer Success .