> For the complete documentation index, see [llms.txt](https://commandbox.ortusbooks.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://commandbox.ortusbooks.com/5.7.0/embedded-server/configuring-your-server/jvm-args.md).

# JVM Args

The following JVM Args are supported when starting the embedded server.

## heapSize

You can set the max heap size the server is allowed to have (`-Xmx`) by passing the `heapSize` parameter to the `start` command. This parameter defaults to megabytes but you can specify any valid suffix.

```bash
start heapSize=1024
```

In `server.json`

```bash
server set JVM.heapSize=1024
server set JVM.heapSize=2G
server show JVM.heapSize
```

## minHeapSize

You can set the starting heap size for the server (`-Xms`) by passing the `minHeapSize` parameter to the `start` command. This parameter defaults to megabytes but you can specify any valid suffix.

```bash
start minHeapSize=1024
```

In `server.json`

```bash
server set JVM.minHeapSize=1024
server set JVM.minHeapSize=2G
server show JVM.minHeapSize
```

## Ad Hoc JVM Args

You can specify ad-hoc JVM args for the server with the `JVMArgs` parameter.

```bash
start JVMArgs="-XX:MaxGCPauseMillis\=200"
```

In `server.json`

```bash
server set JVM.args="-XX:MaxGCPauseMillis\=200"
server show JVM.args
```

JVM args can also be set an array of strings which prevents you from needing to escape or quote anything. &#x20;

```
{
  "jvm" : {
    "args" : [
       "-XX:+UseG1GC",
       "-XX:-CreateMinidumpOnCrash",
       "--add-opens=java.base/java.net=ALL-UNNAMED"
    ]
  }
}
```

Or via the CLI like so:

```
server set jvm.args=["-XX:+UseG1GC"]
server set jvm.args=["-XX:-CreateMinidumpOnCrash"] --append
server set jvm.args=["--add-opens=java.base/java.net=ALL-UNNAMED"] --append
```

## Ad Hoc Runwar Options

You can specify ad-hoc options for the underlying Runwar library using the `RunwarArgs` parameter.

```bash
start RunwarArgs="--sendfile-enable false"
```

In `server.json`

```bash
server set runwar.args="--sendfile-enable false"
server show runwar.args
```

Runwar args can also be set an array of strings which prevents you from needing to escape or quote anything. &#x20;

```
{
  "runwar" : {
    "args" : [
      "--runwar-option",
      "value",
      "--runwar-option2",
      "value2"
    ]
  }
}
```

Or via the CLI like so:

```
server set runwar.args=["--runwar-option","value"]
server set runwar.args=["--runwar-option2","value2"] --append
```


---

# 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://commandbox.ortusbooks.com/5.7.0/embedded-server/configuring-your-server/jvm-args.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.
