From an againg test, which repeatedly launch/terminate an empty
service app, we can find that memory size is continuously
increasing.
With checking service_runner.ts line by line, I figure out that
parentPort (MessagePort) is related to memory leak.
parentPort.close() can be effective to make memory usage stable
a little.
Change-Id: Ia5737915507452100e729246e8f658715d603e81
Signed-off-by: DongHyun Song <dh81.song@samsung.com>
writable: false
});
- // FIXME: this should be 'wrt.tv?.serviceMount(id)' after Tizen 6.5 release
- (wrt.tv as any)?.serviceMount(id);
-
+ wrt.tv?.serviceMount(id);
let filename = workerData.filename;
start(id, filename);
- if (!parentPort)
- return;
- parentPort.on('message', (message) => {
+ parentPort?.on('message', (message) => {
console.debug(`Received message type : ${message.type}`);
if (message.type === 'wake') {
app?.onRequest();
setTimeout(() => {
XWalkExtension.cleanup();
parentPort?.postMessage("will-terminate");
- (wrt.tv as any)?.serviceUmount(id);
+ parentPort?.close();
+ wrt.tv?.serviceUmount(id);
}, message.delay);
}
});