From 6067ac3c93d108adafe92fae74a08b0fedd3f07d Mon Sep 17 00:00:00 2001 From: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com> Date: Tue, 9 Jan 2024 19:34:54 +0000 Subject: [PATCH] ios: more aggressive GC in NSE --- apps/ios/SimpleX NSE/NotificationService.swift | 1 + apps/ios/SimpleXChat/hs_init.c | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/apps/ios/SimpleX NSE/NotificationService.swift b/apps/ios/SimpleX NSE/NotificationService.swift index 529192423..1c34796ec 100644 --- a/apps/ios/SimpleX NSE/NotificationService.swift +++ b/apps/ios/SimpleX NSE/NotificationService.swift @@ -485,6 +485,7 @@ func doStartChat() -> DBMigrationResult? { logger.debug("NotificationService: doStartChat") haskell_init_nse() let (_, dbStatus) = chatMigrateInit(confirmMigrations: defaultMigrationConfirmation(), backgroundMode: true) + logger.debug("NotificationService: doStartChat \(String(describing: dbStatus))") if dbStatus != .ok { resetChatCtrl() NSEChatState.shared.set(.created) diff --git a/apps/ios/SimpleXChat/hs_init.c b/apps/ios/SimpleXChat/hs_init.c index b597453be..83056fccf 100644 --- a/apps/ios/SimpleXChat/hs_init.c +++ b/apps/ios/SimpleXChat/hs_init.c @@ -25,13 +25,15 @@ void haskell_init(void) { } void haskell_init_nse(void) { - int argc = 5; + int argc = 7; char *argv[] = { "simplex", "+RTS", // requires `hs_init_with_rtsopts` "-A1m", // chunk size for new allocations "-H1m", // initial heap size - "-xn", // non-moving GC + "-F0.5", // heap growth triggering GC + "-Fd1", // memory return + "-c", // compacting garbage collector 0 }; char **pargv = argv;