Skip to main content

Nexus Repository Memory Overview

The sections below explain the different configurable memory types, Java arguments for managing certain memory configurations, and examples of using those Java arguments.

Configurable Memory Types

The following table describes the configurable memory types for Sonatype Nexus Repository deployments; visit the Configuring the Runtime Environment page to learn how to change the default memory settings.

Memory Type

Description

Notable Requirements

Java Virtual Machine (JVM) Heap Memory

Stores all the objects created by the Java application. The JVM manages this space, and a special process called garbage collection automatically cleans up unused objects to free up memory.

  • You must specify a min (-Xms) and max (-Xmx); these values should be identical

  • Do not increase the heap memory larger than recommendations or set the min and max to be different; this will cause performance issues

  • Min allowable is 2703M

  • If you go beyond 8G, ensure there is enough RAM to handle and that G1GC garbage collection is enabled

Host or OS Physical Memory (RAM)

  • Total memory allocated to the entire OS or virtual hardware

  • Commonly called RAM

  • Min allowable is 8G; no max limit

  • Minimum unallocated host physical/RAM memory should be no less than 1/3 of total physical RAM to allow for virtual memory swap

  • max heap + max direct memory <= host physical/RAM * 2/3

JVM Direct Memory

  • Reserved section of OS physical memory that Java programs access directly, bypassing and completely independent of heap memory

  • Allocated outside of and distinctly from heap memory

  • Managed by application code that needs to process large amounts of data at once

  • Required only for legacy OrientDB

  • Min allowable is 2703M

  • Must configure a max value

    • (host physical/RAM * 2/3) - JVM max heap

Example Maximum Memory Configurations

The tables below provide example memory configurations using the Java arguments explained in the memory-related Java arguments section.

Physical/RAM Memory

Example Max Memory Configuration for PostgreSQL

Example Max Memory Configuration for H2

Example Max Memory Configuration for OrientDB

8GB

-Xms5G
-Xmx5G
-Xms5G
-Xmx5G
-Xms2703M
-Xmx2703M
-XX:MaxDirectMemorySize=2703M

16GB

-Xms11G
-Xmx11G
-Xms11G
-Xmx11G
-Xms4G
-Xmx4G
-XX:MaxDirectMemorySize=6717M

32GB

-Xms24G
-Xmx24G
-XX:+UseG1GC

Deployments of this scale should use PostgreSQL

Deployments of this scale should use PostgreSQL

64GB

-Xms47G
-Xmx47G
-XX:+UseG1GC

Deployments of this scale should use PostgreSQL

Deployments of this scale should use PostgreSQL