mirror of
https://github.com/bisq-network/bisq.git
synced 2025-02-24 07:07:43 +01:00
Add log for free memory
This commit is contained in:
parent
f0dd8322de
commit
e12f11e538
1 changed files with 4 additions and 4 deletions
|
@ -137,9 +137,9 @@ public abstract class ExecutableForAppWithP2p extends BisqExecutable implements
|
|||
double warningTrigger = maxMemory * 0.8;
|
||||
if (usedMemoryInMB > warningTrigger) {
|
||||
log.warn("\n\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n" +
|
||||
"We are over 80% of our memory limit ({}) and call the GC. usedMemory: {} MB" +
|
||||
"We are over 80% of our memory limit ({}) and call the GC. usedMemory: {} MB. freeMemory: {} MB" +
|
||||
"\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n\n",
|
||||
(int) warningTrigger, usedMemoryInMB);
|
||||
(int) warningTrigger, usedMemoryInMB, Profiler.getFreeMemoryInMB());
|
||||
System.gc();
|
||||
Profiler.printSystemLoad(log);
|
||||
}
|
||||
|
@ -148,9 +148,9 @@ public abstract class ExecutableForAppWithP2p extends BisqExecutable implements
|
|||
long usedMemory = Profiler.getUsedMemoryInMB();
|
||||
if (usedMemory > maxMemory) {
|
||||
log.warn("\n\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n" +
|
||||
"We are over our memory limit ({}) and trigger a restart. usedMemory: {} MB" +
|
||||
"We are over our memory limit ({}) and trigger a restart. usedMemory: {} MB. freeMemory: {} MB" +
|
||||
"\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n\n",
|
||||
(int) maxMemory, usedMemory);
|
||||
(int) maxMemory, usedMemory, Profiler.getFreeMemoryInMB());
|
||||
restart(environment, gracefulShutDownHandler);
|
||||
}
|
||||
}, 5);
|
||||
|
|
Loading…
Add table
Reference in a new issue