-
Notifications
You must be signed in to change notification settings - Fork 125
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: John Alon G <[email protected]> Signed-off-by: Nicolas MASSART <[email protected]> Signed-off-by: Alexandra Tran <[email protected]> Co-authored-by: John Alon G <[email protected]> Co-authored-by: Nicolas MASSART <[email protected]> Co-authored-by: Alexandra Tran <[email protected]>
- Loading branch information
1 parent
1a1fa57
commit b9d08d2
Showing
8 changed files
with
101 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
title: Configure Java and Besu | ||
tags: | ||
- private networks | ||
hide: | ||
- feedback | ||
--- | ||
|
||
# Configure the Java Virtual Machine | ||
|
||
This section contains information on configuring Besu and the Java Virtual Machine (JVM). |
File renamed without changes.
74 changes: 74 additions & 0 deletions
74
docs/public-networks/how-to/configure-jvm/manage-memory.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
--- | ||
description: Besu memory management | ||
tags: | ||
- private networks | ||
--- | ||
|
||
# Manage JVM memory | ||
|
||
You can manage Java Virtual Machine (JVM) memory usage for Besu by modifying the maximum heap size. | ||
|
||
By default, the JVM uses 25% of system RAM. | ||
For example, if you have 16 GB RAM installed, the JVM uses 4 GB by default. | ||
|
||
On public networks, we recommend setting the maximum heap size to: | ||
|
||
- 3 GB on an 8 GB RAM system. | ||
- 5 GB on a 16 GB RAM system. | ||
- 8 GB on a system with at least 24 GB RAM. | ||
|
||
!!! note | ||
|
||
Setting a higher maximum heap size speeds up the sync period but doesn't have much impact | ||
after sync. | ||
Thus, we recommend setting it to 8 GB only when you have available RAM. | ||
|
||
You can set the maximum heap size using the `BESU_OPTS` environment variable and the `-Xmx` option. | ||
The following examples set the maximum heap size to 8 GB: | ||
|
||
=== "Exported environment variable example" | ||
|
||
Set the variable for the whole shell before running Besu. | ||
|
||
```bash | ||
export BESU_OPTS=-Xmx8g | ||
``` | ||
|
||
=== "Inline environment variable example" | ||
|
||
Set the variable only for the specific Besu command. | ||
|
||
```bash | ||
BESU_OPTS=-Xmx8g besu [Besu options] | ||
``` | ||
|
||
=== "`.service` file example" | ||
|
||
```bash | ||
[Service] | ||
... | ||
Environment="BESU_OPTS=-Xmx8g" | ||
ExecStart=besu [Besu options] | ||
... | ||
``` | ||
|
||
## Manage the heap dump | ||
|
||
Heap dump file generation is disabled by default. | ||
To enable it, set the `-XX:+HeapDumpOnOutOfMemoryError` Java option. | ||
|
||
```bash | ||
BESU_OPTS="-XX:+HeapDumpOnOutOfMemoryError" | ||
``` | ||
|
||
When heap dump file generation is enabled, and an out-of-memory error occurs, the heap dump file is | ||
saved in the Besu runtime directory by default. | ||
|
||
The heap dump file might be large and can saturate your drive. | ||
It can be up to the size of the allocated memory. | ||
For example, for 8 GB heap memory, the file can be up to 8 GB. | ||
Specify the directory where you want the dump to be saved using the `-XX:HeapDumpPath` Java option. | ||
|
||
```bash | ||
BESU_OPTS="-XX:HeapDumpPath=/<path>/<to>/<directory>" | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters