Back to course

Memory Management: Pointers vs References

React Native 2026: Bridgeless Architecture & JSI

Memory in JSI

In JS, the Garbage Collector (GC) handles memory. In C++, you have more control. When using JSI, you must understand how to manage objects so they don't cause memory leaks.

  • Shared Pointers: Automatically track ownership.
  • Weak Pointers: Avoid circular references.
  • JS Values: How JSI keeps JS objects alive while C++ is using them.