Skip to content

Commit

Permalink
Remove AllocInYoung/RevertToYGAtTTI from OSS Hermes config (#36679)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #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
  • Loading branch information
javache authored and facebook-github-bot committed Mar 28, 2023
1 parent 4e0dfed commit a83c192
Showing 1 changed file with 1 addition and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit a83c192

Please sign in to comment.