Difference between revisions of "Reducing memory usage"

From Bisq Wiki
Jump to navigation Jump to search
m
Line 1: Line 1:
== Default MaxRAM Setting ==
+
One of the settings Java virtual machines (JVMs) use to calibrate how much physical memory to reserve at startup is '''MaxRAM''', and there is a good chance your JVM's default MaxRAM configuration is too large.
  
One of the settings java virtual machines (JVMs) use to calibrate how much physical memory to reserve at startup is '''MaxRAM''', and there is a good chance your JVM's default MaxRAM configuration is too large. &nbsp;&nbsp; To check the default MaxRAM setting, run this java <code>version</code> command:   
+
To check the default MaxRAM setting, run this <code>java</code> command:   
  
 
     java -XX:+UnlockDiagnosticVMOptions -XX:+PrintFlagsFinal -version | grep MaxRAM
 
     java -XX:+UnlockDiagnosticVMOptions -XX:+PrintFlagsFinal -version | grep MaxRAM
  
Look for the MaxRAM value (bytes) in the output;  this machine says
+
Look for the <code>MaxRAM</code> value (bytes) in the output. An example:
  
 
     367: uint64_t MaxRAM = 137438953472  
 
     367: uint64_t MaxRAM = 137438953472  
Line 11: Line 11:
 
This means the OpenJDK 11 JVM's MaxRAM setting is 128 GB, on a machine with only 16 GB RAM.
 
This means the OpenJDK 11 JVM's MaxRAM setting is 128 GB, on a machine with only 16 GB RAM.
  
 +
Experiments have shown running Bisq with a 4 GB MaxRAM setting reduces resident memory consumption by more than 50% (when starting a clean Bisq installation with an empty data directory). Setting MaxRAM to 2 GB reduces resident memory usage even more, but setting it any lower (1536m) will result in an OutOfMemoryError and crash the app.
  
Experiments have shown running Bisq with a 4g (GB) MaxRAM setting reduces resident memory consumption by more than 50% (when starting a clean Bisq installation with an empty data directory).
+
As of version 1.3.2, Bisq is started with a MaxRAM setting of 4 GB. If you are using Bisq v1.3.1 or older, consider upgrading to the [https://bisq.network/downloads latest version] to benefit from this change.
&nbsp;&nbsp; Setting MaxRAM to 2g reduces resident memory usage even more, but setting it any lower (1536m) will result in an OutOfMemoryError and crash the app.
 
 
 
 
 
As of version 1.3.2, Bisq is started with a MaxRAM setting of 4g (GB). &nbsp;&nbsp; If you are using Bisq v1.3.1 or older, consider upgrading to the [https://bisq.network/downloads latest version] to benefit from this change.
 

Revision as of 12:16, 12 June 2020

One of the settings Java virtual machines (JVMs) use to calibrate how much physical memory to reserve at startup is MaxRAM, and there is a good chance your JVM's default MaxRAM configuration is too large.

To check the default MaxRAM setting, run this java command:

   java -XX:+UnlockDiagnosticVMOptions -XX:+PrintFlagsFinal -version | grep MaxRAM

Look for the MaxRAM value (bytes) in the output. An example:

   367: uint64_t MaxRAM = 137438953472 

This means the OpenJDK 11 JVM's MaxRAM setting is 128 GB, on a machine with only 16 GB RAM.

Experiments have shown running Bisq with a 4 GB MaxRAM setting reduces resident memory consumption by more than 50% (when starting a clean Bisq installation with an empty data directory). Setting MaxRAM to 2 GB reduces resident memory usage even more, but setting it any lower (1536m) will result in an OutOfMemoryError and crash the app.

As of version 1.3.2, Bisq is started with a MaxRAM setting of 4 GB. If you are using Bisq v1.3.1 or older, consider upgrading to the latest version to benefit from this change.