bisq icon indicating copy to clipboard operation
bisq copied to clipboard

Java Heap Space error

Open ThisMightHelp opened this issue 3 years ago • 27 comments

Description

Java Heap Space error. No other info.

Version

v1.6.4

Steps to reproduce

One time occurence

Expected behaviour

Unknown

Actual behaviour

Unknown

Screenshots

SS java heap space error 6-1-2021.odt

Device or machine

Win 10 Pro

Additional info

I saved the log file, but can't find it. How do I redisplay it from within the UI? Thanks.

ThisMightHelp avatar Jun 01 '21 22:06 ThisMightHelp

@ThisMightHelp You can find the log file here: https://bisq.wiki/Data_directory#Windows

Unfortunately I wasn't able to display the screenshot file you posted. For how long did your client run before this happened? How much RAM do you have available on your machine?

ripcurlx avatar Jun 02 '21 09:06 ripcurlx

I have the same problem on Linux Ubuntu with Oracle Hotspot Java / OpenJDK JRE.

image

From the logs:

Jun-02 08:04:51.803 [Write-DaoStateStore_to-disk] ERROR b.c.s.CommonSetup: Uncaught Exception from thread Write-DaoStateStore_to-disk
Jun-02 08:04:51.803 [Write-DaoStateStore_to-disk] ERROR b.c.s.CommonSetup: throwableMessage= Java heap space
Jun-02 08:04:51.803 [Write-DaoStateStore_to-disk] ERROR b.c.s.CommonSetup: throwableClass= class java.lang.OutOfMemoryError
Jun-02 08:04:51.803 [Write-DaoStateStore_to-disk] ERROR b.c.s.CommonSetup: Stack trace:
java.lang.OutOfMemoryError: Java heap space

Usually it happens 1-2x a day, my machine runs 6GB RAM. Linux bisq 5.11.0-18-generic #19-Ubuntu SMP Fri May 7 14:22:03 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

marekbedy avatar Jun 02 '21 14:06 marekbedy

Thanks ripcurlz. The screenshot was the same as marekbedy's. It happened once before, but otherwise Bisq seems ok. Bisq was running for a few hours when the error popped up. Running Win 10 Pro and 32GB RAM.

ThisMightHelp avatar Jun 02 '21 17:06 ThisMightHelp

I have been getting this message once or twice a day both in 1.64 and 1.6.5. Sometimes able to continue, sometimes requires a force close and restart.

Also Bisq is freezing about once a day with no error message and requires a forced shutdown, not sure if related.

pazza83 avatar Jun 03 '21 22:06 pazza83

Thanks.

ThisMightHelp avatar Jun 04 '21 18:06 ThisMightHelp

This all sounds a little bit as if the launch parameters for the VM are not passed successfully. As we changed the packaging of the installer this could be the case for this issue. I'll investigate this today.

ripcurlx avatar Jun 07 '21 07:06 ripcurlx

Or the new VM is more resource hungry than the old one. Could you please try to manually increase the max RAM ceiling we have in place right now (4 GB)? See https://bisq.wiki/Reducing_memory_usage on how to do this.

ripcurlx avatar Jun 07 '21 07:06 ripcurlx

If this fixes it, we have to adapt the value for the next release.

ripcurlx avatar Jun 07 '21 07:06 ripcurlx

You can see all the default jvm opts with java -XX:+UnlockDiagnosticVMOptions -XX:+PrintFlagsFinal -version. I just looked at JDK 16's, and the default MaxRAM is still 128 Gb: uint64_t MaxRAM = 137438953472 I'm sure it's the same in JDK 15.

ghubstan avatar Jun 07 '21 13:06 ghubstan

Did anyone of you had success increasing the max memory flag as described in https://bisq.wiki/Reducing_memory_usage?

ripcurlx avatar Jun 10 '21 13:06 ripcurlx

I tried it with JAVA_TOOL_OPTIONS="-XX:MaxRAM=8g"

Seemed to last a little longer but still crashed with the same error.

I will try again with a higher number.

The Java Heap Space Errors seem to becoming for frequent. Every few hours or so.

pazza83 avatar Jun 10 '21 14:06 pazza83

🤔 this seems to become more and more of an issue. Not sure if it is related to code changes introduced in v1.6.5+ or the new VM and runtime.

ripcurlx avatar Jun 11 '21 08:06 ripcurlx

Try disabling the hardware graphics acceleration with https://github.com/bisq-network/bisq/issues/5362#issuecomment-808793182, curious if the issue still happens afterwards.

Sometimes JavaFX has issues with specific graphic cards with specific drivers. From what I read in different forums, disabling hardware acceleration bypasses some of these issues.

cd2357 avatar Jun 11 '21 09:06 cd2357

Been running all day with no crashes when I upped it to 16gb: JAVA_TOOL_OPTIONS="-XX:MaxRAM=16g"

Not tried disabling the hardware graphics acceleration yet.

pazza83 avatar Jun 12 '21 00:06 pazza83

Crashes where still happening pretty frequently so edited the Bisq.cfg file in Local\Bisq\app to the below to include @cd2357's suggestion, it has seemed to fix a few memory issues. Hopefully it will resolve the Java heap space error also:

[Application] app.classpath=$APPDIR\desktop-1.6.5-all.jar app.mainclass=bisq.desktop.app.BisqAppMain

[JavaOptions] java-options=-Xss1280k java-options=-XX:MaxRAM=32g java-options=-Djava.net.preferIPv4Stack=true java-options=--module-path java-options=$APPDIR\mods

[JVMOptions] -Dprism.order=sw

pazza83 avatar Jun 20 '21 07:06 pazza83

If we enough data we probably should add this parameters as defaults for the built binaries.

ripcurlx avatar Jun 22 '21 14:06 ripcurlx

I have not had a java heap space error since editing the Bisq.cfg file 3 days ago.

pazza83 avatar Jun 22 '21 20:06 pazza83

-Dprism.order=sw helps for me, now a week without a crash

marekbedy avatar Jun 23 '21 09:06 marekbedy

More Java heap space today's on VERSION=1.7.0

[JavaFX Application Thread] INFO  b.c.p.PersistenceManager: Serializing DaoStateStore took 685 msec
[JavaFX Application Thread] ERROR b.c.s.CommonSetup: Uncaught Exception from thread JavaFX Application Thread
[JavaFX Application Thread] ERROR b.c.s.CommonSetup: throwableMessage= Java heap space
[JavaFX Application Thread] ERROR b.c.s.CommonSetup: throwableClass= class java.lang.OutOfMemoryError
[JavaFX Application Thread] ERROR b.c.s.CommonSetup: Stack trace:
java.lang.OutOfMemoryError: Java heap space
	at java.base/java.util.HashMap.newNode(Unknown Source)
	at java.base/java.util.HashMap.putVal(Unknown Source)
	at java.base/java.util.HashMap.putIfAbsent(Unknown Source)
	at java.base/java.util.stream.Collectors.lambda$uniqKeysMapAccumulator$1(Unknown Source)
	at java.base/java.util.stream.Collectors$$Lambda$42/0x0000000100113b98.accept(Unknown Source)
	at java.base/java.util.stream.ReduceOps$3ReducingSink.accept(Unknown Source)
	at java.base/java.util.HashMap$EntrySpliterator.forEachRemaining(Unknown Source)
	at java.base/java.util.stream.ReferencePipeline$Head.forEach(Unknown Source)
	at java.base/java.util.stream.ReferencePipeline$7$1.accept(Unknown Source)
	at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(Unknown Source)
	at java.base/java.util.stream.AbstractPipeline.copyInto(Unknown Source)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
	at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(Unknown Source)
	at java.base/java.util.stream.AbstractPipeline.evaluate(Unknown Source)
	at java.base/java.util.stream.ReferencePipeline.collect(Unknown Source)
	at bisq.network.p2p.storage.persistence.AppendOnlyDataStoreService.getMap(AppendOnlyDataStoreService.java:87)
	at bisq.network.p2p.storage.P2PDataStorage.addPersistableNetworkPayload(P2PDataStorage.java:679)
	at bisq.network.p2p.storage.P2PDataStorage.lambda$onMessage$22(P2PDataStorage.java:593)
	at bisq.network.p2p.storage.P2PDataStorage$$Lambda$1442/0x00000001007d1d10.accept(Unknown Source)
	at java.base/java.util.Optional.ifPresent(Unknown Source)
	at bisq.network.p2p.storage.P2PDataStorage.onMessage(P2PDataStorage.java:583)
	at bisq.network.p2p.network.NetworkNode.lambda$onMessage$6(NetworkNode.java:392)
	at bisq.network.p2p.network.NetworkNode$$Lambda$1329/0x00000001007ac170.accept(Unknown Source)
	at java.base/java.util.Spliterators$ArraySpliterator.forEachRemaining(Unknown Source)
	at java.base/java.util.stream.ReferencePipeline$Head.forEach(Unknown Source)
	at bisq.network.p2p.network.NetworkNode.onMessage(NetworkNode.java:392)
	at bisq.network.p2p.network.Connection.lambda$onBundleOfEnvelopes$11(Connection.java:470)
	at bisq.network.p2p.network.Connection$$Lambda$1441/0x00000001007d1ae0.accept(Unknown Source)
	at java.base/java.util.concurrent.CopyOnWriteArrayList.forEach(Unknown Source)
	at java.base/java.util.concurrent.CopyOnWriteArraySet.forEach(Unknown Source)
	at bisq.network.p2p.network.Connection.lambda$onBundleOfEnvelopes$12(Connection.java:470)
	at bisq.network.p2p.network.Connection$$Lambda$1440/0x00000001007d18c0.run(Unknown Source)

Java heap space

Could you please try out to increase the max ram limit as described in https://bisq.wiki/Reducing_memory_usage? We'll adapt the default value for the next release if it isn't a memory leak we can fix.

ripcurlx avatar Jun 30 '21 10:06 ripcurlx

I encountered the same issue on a MacOS BigSur v11.4

haromz avatar Jul 07 '21 08:07 haromz

Same issue here on MacOS High Sierra 10.13.6 with 8GB RAM

eigentsmis avatar Jul 09 '21 12:07 eigentsmis

Version 1.7.0 on Windows 10. My CPU fan suddenly started running on full speed so I checked Task Manager and saw Bisq consuming >90% of CPU power, a few seconds later it gives the "Java heap space" error and apparently starts working fine again.

vostrnad avatar Jul 10 '21 04:07 vostrnad

Version 1.7.0 on Debian 10.9. I can't even keep Bisq running for longer than 5 minutes before it crashes/hangs saying "java.lang.OutOfMemoryError: Java heap space". I think it was a little more stable on older versions, where it could run for at least 1-2 hours before crashing but that could just be the conditions of my system. I have 2 GB ram and 4 GB swap on my desktop. A lot of memory is taken up by bitcoind, chrome, and other desktop apps. So it does seem to swap a lot, BUT i still usually have > 1.5 GB of swap free. So I'm not sure why it's running out of memory.

microlancer avatar Jul 13 '21 15:07 microlancer

Just following up that I have not had a java heap space error since editing the Bisq.cfg file 28 days ago.

I did need to update the Bisq.cfg when upgrading to 1.7.0 as it was overwritten by the update.

It now reads:

[Application] app.classpath=$APPDIR\desktop-1.7.0-all.jar app.mainclass=bisq.desktop.app.BisqAppMain

[JavaOptions] java-options=-Xss1280k java-options=-XX:MaxRAM=32g java-options=-Djava.net.preferIPv4Stack=true java-options=--module-path java-options=$APPDIR\mods

[JVMOptions] -Dprism.order=sw

pazza83 avatar Jul 18 '21 01:07 pazza83