> For the complete documentation index, see [llms.txt](https://docs.openiam.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.openiam.com/troubleshooting/performance/memoryutili.md).

# Check memory utilization

Finding how much memory each Java service is allowed and what it is actually using, including a heap summary from a running process.

Every OpenIAM service, along with OpenSearch and Cassandra, runs as a Java process with its own memory ceiling. Two questions come up: what is each one *allowed*, and what is one of them *using*.

| Symptom                                                                       | Likely cause                                                    | Resolution                                                                                    |
| ----------------------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------------------------------------- |
| A service restarts repeatedly, or logs an out-of-memory error                 | Its heap ceiling is too low for the load                        | Read the ceiling below, then [Increasing RAM](/troubleshooting/performance/increasing-ram.md) |
| The host is short of memory and you need to know which service is responsible | Several services sized independently, and their ceilings add up | Read the ceilings below and compare the total against the host                                |

## What each service is allowed

```bash
ps -ef | grep java
```

This lists the running Java processes with the arguments each was started with. The **`-Xmx` value is the heap ceiling** for that service, and the number before the timestamp is its PID.

{% code overflow="wrap" expandable="true" %}

```
openiam    16649   16646  2 16:39 ?        00:05:44 /usr/local/openiam/jdk/bin/java -Dlogging.level.root=WARN -Dlogging.level.org.openiam=WARN -Dconfpath=/usr/local/openiam -jar -Xmx1024m -Djdk.tls.client.protocols=TLSv1.2 /usr/local/openiam/services/bin/auth-manager.jar
openiam    16690   16687  1 16:39 ?        00:02:27 /usr/local/openiam/jdk/bin/java -Dlogging.level.root=WARN -Dlogging.level.org.openiam=WARN -Dconfpath=/usr/local/openiam -jar -Xmx256m -Djdk.tls.client.protocols=TLSv1.2 /usr/local/openiam/services/bin/device-manager.jar
openiam    16733   16728  1 16:39 ?        00:03:07 /usr/local/openiam/jdk/bin/java -Dlogging.level.root=WARN -Dlogging.level.org.openiam=WARN -Dconfpath=/usr/local/openiam -jar -Xmx512m -Djdk.tls.client.protocols=TLSv1.2 /usr/local/openiam/services/bin/email-manager.jar
openiam    16813   16774  1 16:39 ?        00:04:17 /usr/local/openiam/jdk/bin/java -Dlogging.level.root=WARN -Dlogging.level.org.openiam=WARN -Dconfpath=/usr/local/openiam -jar -Xmx2048m -Djdk.tls.client.protocols=TLSv1.2 /usr/local/openiam/services/bin/openiam-esb.jar
openiam    16820   16811  1 16:39 ?        00:02:44 /usr/local/openiam/jdk/bin/java -Dlogging.level.root=WARN -Dlogging.level.org.openiam=WARN -Dconfpath=/usr/local/openiam -jar -Xmx512m -Djdk.tls.client.protocols=TLSv1.2 /usr/local/openiam/services/bin/groovy-manager.jar
openiam    16879   16877  2 16:39 ?        00:04:59 /usr/local/openiam/jdk/bin/java -Dlogging.level.root=WARN -Dlogging.level.org.openiam=WARN -Dconfpath=/usr/local/openiam -jar -Xmx512m -Djdk.tls.client.protocols=TLSv1.2 /usr/local/openiam/services/bin/idm.jar
```

{% endcode %}

The ceilings differ per service and are set at installation. The listing above is one deployment's — read your own rather than assuming these numbers.

## What one service is actually using

Sending a running JVM a `QUIT` signal makes it write a thread dump and a heap summary to its log:

```bash
kill -3 <PID>
```

{% hint style="info" %}
**Despite the name, this does not stop the service.** `kill -3` sends `SIGQUIT`, which the JVM handles by dumping its state and carrying on. It is safe on a live deployment.
{% endhint %}

The dump goes to that service's log in `/usr/local/openiam/logs`, so read it there:

{% code overflow="wrap" expandable="true" %}

```
tail auth-manager.log

Output:
JNI global refs: 31, weak refs: 0

Heap
 garbage-first heap   total 512000K, used 215965K [0x00000000c0000000, 0x0000000100000000)
  region size 1024K, 138 young (141312K), 10 survivors (10240K)
 Metaspace       used 129663K, capacity 132186K, committed 133768K, reserved 1167360K
  class space    used 15396K, capacity 16406K, committed 16972K, reserved 1048576K
```

{% endcode %}

`total` against `used` on the heap line is the reading you want. A heap sitting close to its total under normal load is the service to raise.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.openiam.com/troubleshooting/performance/memoryutili.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
