joltup / react-native-threads

Create new JS processes for CPU intensive work
MIT License
755 stars 141 forks source link

Memory leakage in js threads #74

Open DillionApple opened 5 years ago

DillionApple commented 5 years ago

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.