diff --git a/common/src/main/java/bisq/common/setup/CommonSetup.java b/common/src/main/java/bisq/common/setup/CommonSetup.java index cc23cf5f6c..0ab19dab31 100644 --- a/common/src/main/java/bisq/common/setup/CommonSetup.java +++ b/common/src/main/java/bisq/common/setup/CommonSetup.java @@ -55,19 +55,21 @@ public class CommonSetup { Version.printVersion(); maybePrintPathOfCodeSource(); Profiler.printSystemLoad(); - Profiler.printSystemLoadPeriodically(10, TimeUnit.MINUTES); // Full DAO nodes (like seed nodes) do not use the GC triggers as it is expected they have sufficient RAM allocated. GcUtil.setDISABLE_GC_CALLS(config.fullDaoNode); - GcUtil.autoReleaseMemory(); - setSystemProperties(); setupSigIntHandlers(gracefulShutDownHandler); DevEnv.setup(config); } + public static void startPeriodicTasks() { + Profiler.printSystemLoadPeriodically(10, TimeUnit.MINUTES); + GcUtil.autoReleaseMemory(); + } + public static void setupUncaughtExceptionHandler(UncaughtExceptionHandler uncaughtExceptionHandler) { Thread.UncaughtExceptionHandler handler = (thread, throwable) -> { // Might come from another thread diff --git a/core/src/main/java/bisq/core/app/BisqExecutable.java b/core/src/main/java/bisq/core/app/BisqExecutable.java index 0ab2895819..3e8fdc587f 100644 --- a/core/src/main/java/bisq/core/app/BisqExecutable.java +++ b/core/src/main/java/bisq/core/app/BisqExecutable.java @@ -130,8 +130,13 @@ public abstract class BisqExecutable implements GracefulShutDownHandler, BisqSet /////////////////////////////////////////////////////////////////////////////////////////// // Headless versions can call inside launchApplication the onApplicationLaunched() manually + // Desktop gets called from JavaFx thread protected void onApplicationLaunched() { configUserThread(); + + // Now we can use the user thread start periodic tasks + CommonSetup.startPeriodicTasks(); + // As the handler method might be overwritten by subclasses and they use the application as handler // we need to setup the handler after the application is created. CommonSetup.setupUncaughtExceptionHandler(this);