Skip to content

Bisq crashes with OutOfMemoryError: Java heap space on a fresh data directory #7989

Description

@Gummihund

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)

  1. Back up the config file:

    sudo cp /opt/bisq/lib/app/Bisq.cfg /opt/bisq/lib/app/Bisq.cfg.bak
  2. Edit it:

    sudo nano /opt/bisq/lib/app/Bisq.cfg
  3. In the [JavaOptions] section, add:

    java-options=-Xmx4g
    
  4. 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

  1. 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.

  2. Back up Bisq.cfg as Bisq.cfg.bak.

  3. Open Bisq.cfg in a text editor with administrator privileges.

  4. In the [JavaOptions] section, add:

    java-options=-Xmx4g
    
  5. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions