Re: [w3c/FileAPI] Blob.close() has several problems (#10)

I think I've actually changed my mind about Blob.close(). The main use-case I've heard for it is to allow websites to make sure memory is freed up when the website no longer needs the blob, to then for example allow it to create more blobs. But that particular use-case wouldn't actually be supported very well by Blob.close() as specified. One issue being that at least in the chrome implementation chrome might not actually be able to free up memory until some time later. And in that case it's not much better than just relying on garbage collection. Possibly a close method that returned a promise (that would resolve when the memory has been freed) would be more useful for this, but would also get even more confusing to explain to web developers. Also the fact that various ongoing usages of the blob might or might not keep the memory alive anyway seems like it would make it very difficult to explain what closing a blob would actually do, other than "the memory might get freed at some point in the future", which garbage collecting the Blob instance itself already does...

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/FileAPI/issues/10#issuecomment-276723382

Received on Wednesday, 1 February 2017 17:30:30 UTC