Skip to main content
Version: v3.6.x LTS

Customizing Java Heap sizes

Customizing Java Heap sizes

Role: system programmer

The Zowe API Mediation Layer is a Java-based application. As such, one of the main performance considerations is the size of the Java memory heap, where all objects are stored. The Java heap size has a direct impact on the available capacity of the applications. Aspects to consider when defining the size are, for example, how many concurrent requests the application should support, and the expected size of average requests. As a systems programmer, you can customize the available Java memory heap size for API Mediation Layer components.

By default, all services (Gateway, Discovery, API Catalog, Caching Service) have a Java heap size of 32 MB as the initial size, and a maximum heap size of 512 MB.

To change the default settings, set components.<component>.heap.init and components.<component>.heap.max

  • component
    Specifies one of the following services:
    • apiml
    • gateway
    • discovery
    • caching-service
    • api-catalog
    • zaas
note

Single-service deployment (modulith): When using the single-service apiml component, the initial heap size is 32 MB and the maximum heap size is 512 MB by default. We recommend a minimum of 1024 MB (1 GB) for production use.

Example with apiml Heap Configuration:

components:
apiml:
heap:
init: 1024
max: 1024

Example with Gateway Service:

components:
gateway:
heap:
init: 1024
max: 1024

The unit is megabytes and cannot be changed. The new values are 1 GB.

Recommendation​

It is recommended to have a fixed heap size in a production environment.

On this page