Closed
Description
Environment
- CLI: 6.2.2
- Cross-platform modules: 6.2.1
- Android Runtime: 6.2.0
- iOS Runtime: 6.2.0
- Plugin(s): all default plugins from tns create, choosed vue, blank, after that add nativescript-dev-webpack
Describe the bug
In android, even worker terminated, the memory will not decrease.
To Reproduce
- Install any ram monitor to app to monitor simulator/phone memory or use any ways to monitor simulator/phone memory
- cd to testworker, type tns run android --bundle
- keep tapping the "Test Worker" button and monitor the simulator free memory.
- Below is the sample free memory before and after I tap 20 times button, I waited few minutes the free memory will not drop back to original even I not do any things.
Expected behavior
The app shall clear the memory used by the worker after worker closed or terminated.
Sample project
- tns create testworker, add worker loader plugin
- Choose vue, blank project
- Modify Home.vue in components/
3.1. add a button
<Button @tap="newworker" text="Test Worker" />
3.2. Import worker
import * as TestWorker from 'nativescript-worker-loader!~/test-worker';
3.3. Add new methods named newworker, code inside put
var worker = new TestWorker();
worker.postMessage('Testing');
worker.onmessage = function(msg)
{
console.log(msg);
worker.terminate();
}
- Create worker named test-worker inside app/, put
require("tns-core-modules/globals");
global.onmessage = function (data)
{
global.postMessage(data);
}
- tns run android --bundle
Additional context
- Android Platform, Android Build Tools both are 29, tested with 28 also
- Simulator is using Google APIs Intel x86 Atom System Image (28)