mirror of
https://github.com/bisq-network/bisq.git
synced 2025-03-13 11:09:10 +01:00
Shot down if memory exceeds limits (restart and the sh run loop would trigger more then 1 java instance to get started)
This commit is contained in:
parent
95fece3af3
commit
c9129e95af
1 changed files with 7 additions and 2 deletions
|
@ -137,8 +137,13 @@ public class StatisticsMain extends BitsquareExecutable {
|
||||||
|
|
||||||
final long finalUsedMemoryInMB = usedMemoryInMB;
|
final long finalUsedMemoryInMB = usedMemoryInMB;
|
||||||
UserThread.runAfter(() -> {
|
UserThread.runAfter(() -> {
|
||||||
if (finalUsedMemoryInMB > maxMemory)
|
if (finalUsedMemoryInMB > maxMemory) {
|
||||||
restart(environment);
|
log.error("\n\n############################################################\n" +
|
||||||
|
"We shut down as we are over our memory limit. usedMemoryInMB: {}" +
|
||||||
|
"\n############################################################\n\n",
|
||||||
|
finalUsedMemoryInMB);
|
||||||
|
System.exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
}, 1);
|
}, 1);
|
||||||
}
|
}
|
||||||
}, CHECK_MEMORY_PERIOD_SEC);
|
}, CHECK_MEMORY_PERIOD_SEC);
|
||||||
|
|
Loading…
Add table
Reference in a new issue