[whatwg] Low Memory Event

Kornel Lesiński kornel at geekhood.net
Sat Jan 1 18:27:06 PST 2011


On Sun, 02 Jan 2011 00:53:48 -0000, Charles Pritchard <chuck at jumis.com>  
wrote:

> 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.

Maybe better solution would be to add "purgeable" flag to canvas (i.e.  
allow browser to clear canvas at any time) or some way to create/mark weak  
references? (i.e. a reference to object that can be changed to null if  
browser is in low-memory situation).

Although, I'm not convinced that handling of low memory in JS is  
necessary. Browsers already have some ways to free memory, e.g. by freeing  
all bitmaps for <img> or simply by unloading whole pages.

Amount of available memory, even on mobile devices, increases dramatically  
each year. It's possible that by the time this feature gets specified,  
implemented, released and installed on significant number of devices it  
will be irrelevant. On my desktop computer I often have 100 tabs open and  
memory is not an issue, and my mobile phone has 1/16th of that RAM already.

-- 
regards, Kornel Lesiński



More information about the whatwg mailing list