Set the max heap size for OSS apps on Android to be 1 GB for Hermes

Summary:
The max heap size currently is 512 MB for OSS apps using Hermes on Android.

Some users (see https://github.com/facebook/hermes/issues/295) are experiencing
long pauses when reaching this ceiling.
Increasing this limit to 1 GB should reduce the frequency of these pauses occurring
for apps where the expected heap usage is near 512 MB.

Changelog: [Internal] Set Hermes's default max heap size to 1 GB

Reviewed By: mhorowitz

Differential Revision: D22577343

fbshipit-source-id: 2d7d688e38e95a082692dca52d010d0449a6e64b
This commit is contained in:
Riley Dulin
2020-07-23 10:26:19 -07:00
committed by Facebook GitHub Bot
parent 63377fa66b
commit 63d20d3b1e
2 changed files with 7 additions and 1 deletions
@@ -17,7 +17,7 @@ public class HermesExecutorFactory implements JavaScriptExecutorFactory {
private final RuntimeConfig mConfig;
public HermesExecutorFactory() {
this(null);
this(new RuntimeConfig(1024));
}
public HermesExecutorFactory(RuntimeConfig config) {
@@ -11,4 +11,10 @@ package com.facebook.hermes.reactexecutor;
public final class RuntimeConfig {
public long heapSizeMB;
public boolean es6Proxy;
RuntimeConfig() {}
RuntimeConfig(long heapSizeMB) {
this.heapSizeMB = heapSizeMB;
}
}