In NodeJS environment, you can see the WorkerConnector.compile() method calls a neighbor WorkerConnector.connect() function. If the WorkerConnector.compile() method throws an exception, then Compiler.remove() cannot be called and it may cause the disk leak.
In Web Browser, WorkerConnector.compile() compiles (creates) a JS file, but does not remove it. Of course, the JS file would be automatically removed when the browser closed, but it seems dangerous. If someone compiles (WorkerConnector.compile()) lots of JS files in a page, then they would be memory leak.
Summary
Code occuring the bug
In NodeJS
https://github.com/samchon/tgrid/blob/ec443a2a8147ff6f5d6f3917cabdbec988fee39b/src/protocols/workers/WorkerConnector.ts#L61-L67
In NodeJS environment, you can see the
WorkerConnector.compile()
method calls a neighborWorkerConnector.connect()
function. If theWorkerConnector.compile()
method throws an exception, thenCompiler.remove()
cannot be called and it may cause the disk leak.In Browser
https://github.com/samchon/tgrid/blob/ec443a2a8147ff6f5d6f3917cabdbec988fee39b/src/protocols/workers/WorkerConnector.ts#L69
In Web Browser,
WorkerConnector.compile()
compiles (creates) a JS file, but does not remove it. Of course, the JS file would be automatically removed when the browser closed, but it seems dangerous. If someone compiles (WorkerConnector.compile()
) lots of JS files in a page, then they would be memory leak.https://github.com/samchon/tgrid/blob/ec443a2a8147ff6f5d6f3917cabdbec988fee39b/src/protocols/workers/internal/web-worker.ts#L9-L13
WorkerConnector.compile()
should utilize not onlyURL.createObject
function, but alsoURL.removeObject
function.