Refactor destruction of ReactInstanceManager during Memory Pressure in FB4A

Summary:
This diff refactors the destruction of the ReactInstanceManager when the app is experiencing low memory.

As part of this refactor, I setup an experiment to understand at what level of memory pressure is convenient to destroy the RN bridge.

The experiment is divided in six levels described in the following table:

https://pxl.cl/1dzx8

https://www.internalfb.com/intern/qe2/fb4a_react_native_memory/android_fb4a_instance_unload_pressure_v2/setup

changelog: [internal] Internal

Reviewed By: JoshuaGross

Differential Revision: D22577553

fbshipit-source-id: 37f8f561099a1ba6239795f5907090ced3b5dd18
This commit is contained in:
David Vacca
2020-07-16 14:47:53 -07:00
committed by Facebook GitHub Bot
parent de094396e3
commit 3d1e127976
2 changed files with 1 additions and 3 deletions
@@ -706,6 +706,7 @@ public class ReactInstanceManager {
synchronized (mHasStartedDestroying) {
mHasStartedDestroying.notifyAll();
}
FLog.d(ReactConstants.TAG, "ReactInstanceManager has been destroyed");
}
private synchronized void moveToResumedLifecycleState(boolean force) {