Bisq crashes with OutOfMemoryError: Java heap space — even on a brand new data directory
Version: Bisq v1.10.4
Symptom: Bisq shuts down with this in bisq.log, often while parsing a new DAO/BSQ block:
ERROR b.c.s.CommonSetup: OutOfMemoryError occurred. We shut down. java.lang.OutOfMemoryError: Java heap space
at bisq.core.dao.monitoring.DaoStateMonitoringService.createHashFromBlock
at bisq.core.dao.state.DaoStateSnapshotService.onDaoStateChanged
This happens even with a completely fresh data directory, so it does not appear to be caused by accumulated wallet/DAO data. The Profiler lines just above the crash show:
INFO b.c.u.Profiler: Total memory: 2 GB; Used memory: 1,913 GB; ... Max memory: 2 GB
Likely root cause: the JVM options bundled with the desktop installer set -XX:MaxRAM=8g but no explicit -Xmx. Without an explicit -Xmx, the G1 collector's default maximum heap is derived as a fraction of MaxRAM, which caps the heap at approximately 2 GB regardless of how much RAM the machine actually has. During DAO state hash-chain computation on a new block, that ceiling appears to be insufficient and the JVM throws an OOM error.
Workaround: add an explicit -Xmx to the app's JVM options, overriding the MaxRAM-derived default. The value should be adjusted to the available RAM; 4g is a reasonable value on a machine with at least 8 GB RAM.
Linux (.deb install)
-
Back up the config file:
sudo cp /opt/bisq/lib/app/Bisq.cfg /opt/bisq/lib/app/Bisq.cfg.bak
-
Edit it:
sudo nano /opt/bisq/lib/app/Bisq.cfg
-
In the [JavaOptions] section, add:
-
Save the file and restart Bisq.
This file belongs to the installed package. A future Bisq update or reinstall via .deb may overwrite it and require the workaround to be reapplied.
Windows
-
Locate the application config file, typically:
C:\Program Files\Bisq\app\Bisq.cfg
The exact path may vary depending on the version or custom installation location. The file should be in the app folder next to Bisq.exe.
-
Back up Bisq.cfg as Bisq.cfg.bak.
-
Open Bisq.cfg in a text editor with administrator privileges.
-
In the [JavaOptions] section, add:
-
Save the file and restart Bisq.
This setting may also be reset by a future Bisq update until the installer supplies an appropriate explicit maximum heap setting.
Log
bisq.log
Bisq crashes with
OutOfMemoryError: Java heap space— even on a brand new data directoryVersion: Bisq v1.10.4
Symptom: Bisq shuts down with this in
bisq.log, often while parsing a new DAO/BSQ block:This happens even with a completely fresh data directory, so it does not appear to be caused by accumulated wallet/DAO data. The
Profilerlines just above the crash show:Likely root cause: the JVM options bundled with the desktop installer set
-XX:MaxRAM=8gbut no explicit-Xmx. Without an explicit-Xmx, the G1 collector's default maximum heap is derived as a fraction ofMaxRAM, which caps the heap at approximately 2 GB regardless of how much RAM the machine actually has. During DAO state hash-chain computation on a new block, that ceiling appears to be insufficient and the JVM throws an OOM error.Workaround: add an explicit
-Xmxto the app's JVM options, overriding theMaxRAM-derived default. The value should be adjusted to the available RAM;4gis a reasonable value on a machine with at least 8 GB RAM.Linux (.deb install)
Back up the config file:
Edit it:
In the
[JavaOptions]section, add:Save the file and restart Bisq.
This file belongs to the installed package. A future Bisq update or reinstall via
.debmay overwrite it and require the workaround to be reapplied.Windows
Locate the application config file, typically:
The exact path may vary depending on the version or custom installation location. The file should be in the
appfolder next toBisq.exe.Back up
Bisq.cfgasBisq.cfg.bak.Open
Bisq.cfgin a text editor with administrator privileges.In the
[JavaOptions]section, add:Save the file and restart Bisq.
This setting may also be reset by a future Bisq update until the installer supplies an appropriate explicit maximum heap setting.
Log
bisq.log