# Memory and threads

## Memory

If you suspect that Orbeon Forms is running out of memory, add the following to your JVM options:

```
-verbosegc -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -XX:+PrintGCDetails
```

This will output GC information to the Tomcat logs. The next time Orbeon Forms locks or gets slow, check the GC information in the servlet container logs. This might indicate whether Orbeon Forms blocks because of an actual memory issue or not.

## Deadlocks

If you suspect that Orbeon Forms is encountering a deadlock, obtain a JVM thread dump. The easiest is to use the `kill` command on Linux/Unix. See for example [How do I generate a Java thread dump on Linux/Unix?](https://access.redhat.com/solutions/18178).


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://doc.orbeon.com/configuration/troubleshooting/memory-and-threads.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
