W3C home > Mailing lists > Public > whatwg@whatwg.org > January 2011

[whatwg] Low Memory Event

From: Charles Pritchard <chuck@jumis.com>
Date: Sat, 01 Jan 2011 16:53:48 -0800
Message-ID: <4D1FCC9C.4030709@jumis.com>
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.
Received on Saturday, 1 January 2011 16:53:48 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:29 UTC