[whatwg] Low Memory Event
Charles Pritchard
chuck at jumis.com
Sat Jan 1 16:53:48 PST 2011
On 1/1/2011 4:48 PM, Glenn Maynard wrote:
> On Sat, Jan 1, 2011 at 7:35 PM, Ryosuke Niwa<rniwa at webkit.org> wrote:
>> What I don't understand about this proposal is how web apps are supposed to
>> free memory. In my understanding, ES5 doesn't allow you to manually free
>> memory (unlike Objective-C), and it's up to GC implementor to decide how and
>> when (most of) resources are freed.
> "Freeing memory" in the context of Javascript means "make available to
> the collector to be freed", eg. drop references. Actually collecting
> any resulting objects as a result of that is up to the implementation:
> presumably a thorough GC pass would be forced after sending this
> message, to actually free memory that the application released.
>
> (That seems simple enough on mobile browsers, but on desktop systems
> doing such a collection pass might force everything to be paged back
> into memory, and to incorrectly hint the OS that everything is active
> and shouldn't be paged back out quickly, so it's probably not that
> simple in practice.)
>
ArrayBuffer and Canvas use contiguous memory segments. You don't need a
complex GC pass to let those ones go.
For my use cases, those are the two types I'm working with.
Keeping them around helps the speed of my app, letting them go
cuts down on memory usage.
More information about the whatwg
mailing list