Skip to main content
Version: Java (Groovy)

Configure and adjust heap size

When launching Deephaven, you may have very specific and perhaps large data needs that require fine-tuned resource management, such as adjusting your heap size (memory).

If you launch Deephaven from pre-built images or build and launch Deephaven from source code, you use Docker to facilitate your containers and resource management. Depending on the applications and data you run, it may be necessary to change the amount of heap available to each of the containers in the system.

See memory settings

To see your Docker configuration, run in a terminal:

docker info | grep Memory

By default, Docker on Mac is configured with 2 GB of RAM. If you need to increase the available memory, open Docker and navigate to Preferences->Resources->Memory.

note

Docker on Windows and Linux does not have this configuration option.

img

To get a better understanding of your resources, you can see the container statistics in a terminal by running the Docker stats built-in command:

docker stats

This shows the live memory usage of all active containers, as well as the limit specified on each container.

The column MEM USAGE / LIMIT includes information like 20.00MiB / 5.804GiB, which means that container is using 20 MiB of RAM out of the alloted 5.8 GiB of RAM. When running your session, you can monitor this live feed to see which containers might need more memory.

Change default heap size

The JAVA_TOOL_OPTIONS=-Xmx4g parameter in the grpc-api container environment controls the amount of memory available to Deephaven. By default, this is set to 4GB of Docker RAM.

To change this setting, nagivate to your Docker-Compose YAML file located in your Deephaven deployment directory. See our guide Docker data volumes for more information.

The Docker-Compose YAML file your installation uses depends on how you launch Deephaven:

Open the Docker-Compose YAML file with the text editor of your choice. You will see several containers listed separately under services. Each container can be fine-tuned.

img

For instance, to use up to 8GB of RAM, change the first parameter to JAVA_TOOL_OPTIONS=-Xmx8g. When the -Xmx parameters are not set, the JVM sizes the heap based on the system specifications.

note

If you are using Docker Desktop, this value is also limited by what is specified in your Docker Preferences->Resources->Memory setting.

Control individual containers

The Docker-Compose YAML file allows you to control each container. Its format depends based on your Docker version.

For example, in version 3.*, you can gain more memory control under each service by supplying specific memory values:

    deploy:
resources:
limits:
cpus: '4.0'
memory: 6000M
reservations:
memory: 1000M

In version 2.*, the same changes to your .yml file would look like:

  mem_limit: 6000m
mem_reservation: 1000M
cpus: 4.0