Skip to content
This repository has been archived by the owner on Sep 9, 2021. It is now read-only.

Memory leak resulting in net::ERR_OUT_OF_MEMORY #208

Closed
michal-lipski opened this issue Jul 4, 2019 · 1 comment · Fixed by #252
Closed

Memory leak resulting in net::ERR_OUT_OF_MEMORY #208

michal-lipski opened this issue Jul 4, 2019 · 1 comment · Fixed by #252

Comments

@michal-lipski
Copy link

The problem

The loader is calling URL.createObjectURL to create URL representing the worker javascript bundle file. The object is never released, and garbage collector can't remove it from memory.
At some point it is not possible to create another object and error is thrown: net::ERR_OUT_OF_MEMORY which means the buffer of the network interface is full.

I am getting this on all browsers.

Proposed solution

According to documentation, we can call revokeObjectURL() to release an object URL.

const objectUrl = URL.createObjectURL(blob);  
const worker = new Worker(objectUrl);  
URL.revokeObjectURL(objectUrl);  
return worker;  
@alexander-akait
Copy link
Member

PR welcome

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants