react-native-threads icon indicating copy to clipboard operation
react-native-threads copied to clipboard

Memory leakage in js threads

Open DillionApple opened this issue 5 years ago • 0 comments

When I start a new thread which executes the following code, the memory will grow rapidly, and cause the app to crash.

setInterval(function () {
  let str = generateLongString(1000 * 1000 * 10); // generate a string with 10M bytes.
  str = null;
}, 0);

I use this piece of code to inject memory stress to the phone. I tried the same code in my browser. The memory will be collected by the browser's GC properly.

DillionApple avatar Jun 16 '19 07:06 DillionApple