I pass the options as
{
...
chunk: () => this.chunk(results,parser),
complete: () => this.complete(results,parser)
}
And this doesn't leak memory when worker is false but leaks memory when worker is true. The leak is because the closures are somehow retained. Looking at the papaparse code it seems that the callback functions are copied to the worker object as worker.userXYZ functions. However, at the end the worker is terminated and deleted. So, ideally the closures should have been freed up too.
Is there any extra step required when using the worker option so the memory is freed up properly?