Notify the garbage collector of the size of loaded models in C++ native code. Host objects' memory is managed by the JS runtime garbage collector, which needs to know the real size of the objects to use a correct strategy when to garbage collect them. This means we need to set the size of a loaded model in JSI (via external memory pressure) to guarantee a proper memory behaviour.
Notify the garbage collector of the size of loaded models in C++ native code. Host objects' memory is managed by the JS runtime garbage collector, which needs to know the real size of the objects to use a correct strategy when to garbage collect them. This means we need to set the size of a loaded model in JSI (via external memory pressure) to guarantee a proper memory behaviour.