From b164302bf6e7ffb538b5e471c18d65fcc14f4877 Mon Sep 17 00:00:00 2001 From: Pieter De Baets Date: Tue, 20 Feb 2024 14:44:59 -0800 Subject: [PATCH] Cleanup ios_hermes:rn_heap_size_mb (#43023) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/43023 Unused mobile config, and is not consistently used across all the many places we can initialize a Hermes instance. Changelog: [Internal] Reviewed By: NickGerleman Differential Revision: D53761942 fbshipit-source-id: a3e1adae87e41142c337a27b33750f82774cf92c --- .../react/runtime/hermes/HermesInstance.cpp | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/packages/react-native/ReactCommon/react/runtime/hermes/HermesInstance.cpp b/packages/react-native/ReactCommon/react/runtime/hermes/HermesInstance.cpp index 13308c81c26..e21f5f7fb58 100644 --- a/packages/react-native/ReactCommon/react/runtime/hermes/HermesInstance.cpp +++ b/packages/react-native/ReactCommon/react/runtime/hermes/HermesInstance.cpp @@ -148,18 +148,11 @@ std::unique_ptr HermesInstance::createJSRuntime( ? reactNativeConfig->getInt64("ios_hermes:vm_experiment_flags") : 0; - int64_t heapSizeConfig = reactNativeConfig - ? reactNativeConfig->getInt64("ios_hermes:rn_heap_size_mb") - : 0; - // Default to 3GB if MobileConfigs is not available - auto heapSizeMB = heapSizeConfig > 0 - ? static_cast<::hermes::vm::gcheapsize_t>(heapSizeConfig) - : 3072; - ::hermes::vm::RuntimeConfig::Builder runtimeConfigBuilder = ::hermes::vm::RuntimeConfig::Builder() .withGCConfig(::hermes::vm::GCConfig::Builder() - .withMaxHeapSize(heapSizeMB << 20) + // Default to 3GB + .withMaxHeapSize(3072 << 20) .withName("RNBridgeless") // For the next two arguments: avoid GC before TTI // by initializing the runtime to allocate directly