---
title: "Gateway Hub - java.lang.OutOfMemoryError: Java heap space"
description: "Java heap space errors occur when the Gateway Hub exceeds its configured maximum memory allocation. Increasing the heap size in the gateway-hub configuration file helps resolve these out of memory issues."
url: "https://docs.itrsgroup.com/docs/faq/geneos/13476498392861-gateway-hub-java-lang-outofmemoryerror-java-heap-space/index.html"
---
If the maximum space available consumed by the application has reach the maximum configured in the java settings, out of memory error message gets presented.

**Example error:**

Uncaught error from thread [default-scheduler-1]: Java heap space, shutting down JVM since 'test.jvm-exit-on-fatal-error' is enabled for ActorSystem[default]
java.lang.OutOfMemoryError: Java heap space

**Solution:**
When encountering this type of error, it is best to increase the heap size to reduce memory issues:

You need to look into your gateway-hub config file (the one you use for hubctl start/stop <config file>) and adjust the following:

```
    # Memory limit in MB.
    # Required: False
    # Default: 64
    memory_limit: 64
```

NOTE: If the Gateway Hub orchestration service has been registered with systemd, it is better to mask the orchestration service when upgrading the operating system on each node. For more information, see [Registration with systemd](https://docs.itrsgroup.com/docs/geneos-gateway-hub/current/Topics/upgrade/upgrade-hub.htm#Registra).


