From fe4176357e5ae759eb4e561af8ab4ddd5b824192 Mon Sep 17 00:00:00 2001 From: Alexander Bondarenko <486682+dpwiz@users.noreply.github.com> Date: Fri, 29 Mar 2024 13:56:41 +0300 Subject: [PATCH] ios: limit RTS memory for NSE --- apps/ios/SimpleXChat/hs_init.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/ios/SimpleXChat/hs_init.c b/apps/ios/SimpleXChat/hs_init.c index adacd57310..fcb9075fd4 100644 --- a/apps/ios/SimpleXChat/hs_init.c +++ b/apps/ios/SimpleXChat/hs_init.c @@ -25,12 +25,14 @@ void haskell_init(void) { } void haskell_init_nse(void) { - int argc = 7; + int argc = 9; char *argv[] = { "simplex", "+RTS", // requires `hs_init_with_rtsopts` "-A1m", // chunk size for new allocations "-H1m", // initial heap size + "-M12m", // maximum heap size (25 total - 1 grace - 12 for swift), make GC work harder when approaching the limit + "-Mgrace=1m", // (default, just to make explicit) extra memory to handle "memory exhausted" exception and fail cleanly "-F0.5", // heap growth triggering GC "-Fd1", // memory return "-c", // compacting garbage collector