Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Java Heap Space error #5550

Open
ThisMightHelp opened this issue Jun 1, 2021 · 27 comments
Open

Java Heap Space error #5550

ThisMightHelp opened this issue Jun 1, 2021 · 27 comments
Labels
a:bug is:priority PR or issue marked with this label is up for compensation on:Windows

Comments

@ThisMightHelp
Copy link

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.
@ripcurlx
Copy link
Contributor

ripcurlx commented Jun 2, 2021

@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?

@marekbedy
Copy link

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

@ThisMightHelp
Copy link
Author

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.

@pazza83
Copy link

pazza83 commented Jun 3, 2021

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.

@ThisMightHelp
Copy link
Author

Thanks.

@ripcurlx
Copy link
Contributor

ripcurlx commented Jun 7, 2021

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
Copy link
Contributor

ripcurlx commented Jun 7, 2021

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
Copy link
Contributor

ripcurlx commented Jun 7, 2021

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

@ghubstan
Copy link
Contributor

ghubstan commented Jun 7, 2021

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.

@ripcurlx
Copy link
Contributor

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

@pazza83
Copy link

pazza83 commented Jun 10, 2021

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.

@ripcurlx
Copy link
Contributor

ripcurlx commented Jun 11, 2021

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

@cd2357
Copy link
Contributor

cd2357 commented Jun 11, 2021

Try disabling the hardware graphics acceleration with #5362 (comment), 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.

@pazza83
Copy link

pazza83 commented Jun 12, 2021

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
Copy link

pazza83 commented Jun 20, 2021

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

@ripcurlx
Copy link
Contributor

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

@pazza83
Copy link

pazza83 commented Jun 22, 2021

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

@marekbedy
Copy link

marekbedy commented Jun 23, 2021

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

@ripcurlx
Copy link
Contributor

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 ripcurlx added the is:priority PR or issue marked with this label is up for compensation label Jul 2, 2021
@haromz
Copy link

haromz commented Jul 7, 2021

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

@eigentsmis
Copy link

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

@vostrnad
Copy link

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.

@microlancer
Copy link

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.

@pazza83
Copy link

pazza83 commented Jul 18, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:bug is:priority PR or issue marked with this label is up for compensation on:Windows
Projects
None yet
Development

No branches or pull requests

11 participants