W3C home > Mailing lists > Public > public-webapps@w3.org > January to March 2012

Re: [FileAPI] Deterministic release of Blob proposal

From: Charles Pritchard <chuck@jumis.com>
Date: Fri, 02 Mar 2012 19:40:23 -0800
Message-ID: <4F5192A7.6060800@jumis.com>
To: Feras Moussa <ferasm@microsoft.com>
CC: "public-webapps@w3.org" <public-webapps@w3.org>, Adrian Bateman <adrianba@microsoft.com>
On 3/2/2012 4:54 PM, Feras Moussa wrote:
>
> At TPAC we discussed the ability to deterministically close blobs with 
> a few
>
> others.
>
>
...
>
> To address this issue, we propose that a close method be added to the 
> Blob
>
> interface.
>
> When called, the close method should release the underlying resource 
> of the
>
> Blob, and future operations on the Blob will return a new error, a 
> ClosedError.
>
> This allows an application to signal when it's finished using the Blob.
>
>

I suppose the theory of Blob is that it can be written to disk. The 
other theory is that reference counting can somehow work magic.
I'm not sure, but it came up before.

I brought up a close mechanism for ArrayBuffer, which is (I believe) 
supposed to be in memory, always.
http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2011-January/029741.html

Also referenced:
http://www.khronos.org/webgl/public-mailing-list/archives/1009/msg00229.html

ArrayBuffer can now be closed out of the current thread via Transferable 
semantics.
I don't know if it disappears into space with an empty postMessage target.

I don't think that works for Blob, though.

Yes, I'd like to see immediate mechanisms to cleanup Blob and ArrayBuffer.
In practical use, it wasn't an issue on the desktop and the iPhone 
hadn't picked up the semantics yet.

But gosh it's no fun trying to navigate memory management on mobile 
device. Thus my low memory event thread.

-Charles
Received on Saturday, 3 March 2012 03:40:40 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 18:49:50 GMT