From a83c1925502e69d6fa1aaf68fc46d9134ffd2086 Mon Sep 17 00:00:00 2001 From: Pieter De Baets Date: Tue, 28 Mar 2023 08:28:32 -0700 Subject: [PATCH] Remove AllocInYoung/RevertToYGAtTTI from OSS Hermes config (#36679) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/36679 We expose a variant of `HermesExecutor.java` which allows you to set a custom max heap size. This variant also sets the `AllocInYoung/RevertToYGAtTTI`, which should never really be used without a matching call to `HermesInternal.ttiReached()`, which is not documented. Changelog: [Internal] Reviewed By: jpporto Differential Revision: D44457318 fbshipit-source-id: e91b377cbc0ac596cfbe7d1178e2657b868c1067 --- .../src/main/jni/react/hermes/reactexecutor/OnLoad.cpp | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/packages/react-native/ReactAndroid/src/main/jni/react/hermes/reactexecutor/OnLoad.cpp b/packages/react-native/ReactAndroid/src/main/jni/react/hermes/reactexecutor/OnLoad.cpp index 6326364220b..d3182e95305 100644 --- a/packages/react-native/ReactAndroid/src/main/jni/react/hermes/reactexecutor/OnLoad.cpp +++ b/packages/react-native/ReactAndroid/src/main/jni/react/hermes/reactexecutor/OnLoad.cpp @@ -31,15 +31,7 @@ static std::once_flag flag; static ::hermes::vm::RuntimeConfig makeRuntimeConfig(jlong heapSizeMB) { namespace vm = ::hermes::vm; - auto gcConfigBuilder = - vm::GCConfig::Builder() - .withName("RN") - // For the next two arguments: avoid GC before TTI by initializing the - // runtime to allocate directly in the old generation, but revert to - // normal operation when we reach the (first) TTI point. - .withAllocInYoung(false) - .withRevertToYGAtTTI(true); - + auto gcConfigBuilder = vm::GCConfig::Builder().withName("RN"); if (heapSizeMB > 0) { gcConfigBuilder.withMaxHeapSize(heapSizeMB << 20); }