Re: [whatwg] Low Memory Event

2011-01-07 Thread Charles Pritchard
Date: Sun, 02 Jan 2011 04:59:14 -0600 From: Boris Zbarsky bzbar...@mit.edu On 1/1/11 6:53 PM, Charles Pritchard wrote: ArrayBuffer and Canvas use contiguous memory segments. You don't need a complex GC pass to let those ones go. Yes, you do. You can't let go of the canvas buffer without

Re: [whatwg] Low Memory Event

2011-01-03 Thread Bjartur Thorlacius
On 1/2/11, Aryeh Gregor simetrical+...@gmail.com wrote: Moreover, who says you're using a browser that puts different tabs in different threads; that that browser would still work correctly if you suspend a single thread and leave the others running; and that you even know that it's possible

Re: [whatwg] Low Memory Event

2011-01-02 Thread Boris Zbarsky
On 1/1/11 6:53 PM, Charles Pritchard wrote: ArrayBuffer and Canvas use contiguous memory segments. You don't need a complex GC pass to let those ones go. Yes, you do. You can't let go of the canvas buffer without letting go of the canvas rendering contexts and canvas elements referencing it.

Re: [whatwg] Low Memory Event

2011-01-02 Thread Boris Zbarsky
On 1/1/11 2:39 PM, Charles Pritchard wrote: lowmemory does not need to mean that the OS is experiencing a low memory condition. Uh... then what does it need to mean? Tabbed browsing implementation: Send a lowmemory event to hidden tabs listening (for lowmemory), that have not been visible

Re: [whatwg] Low Memory Event

2011-01-02 Thread timeless
On Sat, Jan 1, 2011 at 11:17 PM, Bjartur Thorlacius svartma...@gmail.com wrote: On 12/31/10, Ian Hickson i...@hixie.ch wrote: Please don't use all my memory for your Web-based game. :-) I may just be running it in the background while finding a video to watch, for example, in which case I

Re: [whatwg] Low Memory Event

2011-01-02 Thread Bjartur Thorlacius
On 1/2/11, timeless timel...@gmail.com wrote: On Sat, Jan 1, 2011 at 11:17 PM, Bjartur Thorlacius svartma...@gmail.com wrote: On 12/31/10, Ian Hickson i...@hixie.ch wrote: Please don't use all my memory for your Web-based game. :-) I may just be running it in the background while finding a

Re: [whatwg] Low Memory Event

2011-01-02 Thread timeless
On Sun, Jan 2, 2011 at 7:41 PM, Bjartur Thorlacius svartma...@gmail.com wrote: Why wouldn't you suspend the process (i.e. put it to sleep by stopping it). because the server may kill you when the network socket times out or breaks. why should it waste resources on a non responsive client?

Re: [whatwg] Low Memory Event

2011-01-02 Thread Aryeh Gregor
On Sun, Jan 2, 2011 at 4:27 PM, timeless timel...@gmail.com wrote: On Sun, Jan 2, 2011 at 7:41 PM, Bjartur Thorlacius svartma...@gmail.com wrote: Why wouldn't you suspend the process (i.e. put it to sleep by stopping it). because the server may kill you when the network socket times out or

Re: [whatwg] Low Memory Event

2011-01-01 Thread Charles Pritchard
On 1/1/2011 12:08 PM, whatwg-requ...@lists.whatwg.org wrote: Date: Fri, 31 Dec 2010 22:01:42 -0600 From: Boris Zbarsky bzbar...@mit.edu On 12/31/10 7:35 PM, Charles Pritchard wrote: If I were to receive an event, letting me know a low memory condition exists There are various ways to try

Re: [whatwg] Low Memory Event

2011-01-01 Thread Bjartur Thorlacius
On 12/31/10, Ian Hickson i...@hixie.ch wrote: Please don't use all my memory for your Web-based game. :-) I may just be running it in the background while finding a video to watch, for example, in which case I really don't want the game using all my resources. Why would you want to run a game

Re: [whatwg] Low Memory Event

2011-01-01 Thread Glenn Maynard
I'd like to be able to listen for them on the desktop as well. You need to know a lot about the host system to know what low memory even means. Does it mean allocations may start failing soon? Does it mean we're deep into swap, causing serious performance issues but not failed allocations?

Re: [whatwg] Low Memory Event

2011-01-01 Thread Charles Pritchard
On 1/1/2011 1:43 PM, Glenn Maynard wrote: You need to know a lot about the host system to know what low memory even means. Does it mean allocations may start failing soon? Does it ... This definitely seems useful on mobile platforms, where memory is much more limited, memory management is

Re: [whatwg] Low Memory Event

2011-01-01 Thread Glenn Maynard
On Sat, Jan 1, 2011 at 5:04 PM, Charles Pritchard ch...@jumis.com wrote: The separation of Mobile and Desktop seems arbitrary, in terms of specs: if it's useful on the mobile, why would it not be useful on the desktop? It's the same concept, a memory warning. I fully agree that no HTML spec

Re: [whatwg] Low Memory Event

2011-01-01 Thread Ryosuke Niwa
On Sat, Jan 1, 2011 at 2:04 PM, Charles Pritchard ch...@jumis.com wrote: It's the same concept, a memory warning. On Sat, Jan 1, 2011 at 3:39 PM, Charles Pritchardch...@jumis.com wrote: Here are some example implementations; it's up to the vendor, not the spec. Tabbed browsing

Re: [whatwg] Low Memory Event

2011-01-01 Thread Charles Pritchard
On 1/1/2011 4:07 PM, Glenn Maynard wrote: For example, responding to being an idle tab by releasing resources is the wrong thing to do if there's plenty of memory available. I have 8 GB of memory and Firefox rarely uses more than 512 MB. Don't make me I stated, in the example, that it would

Re: [whatwg] Low Memory Event

2011-01-01 Thread Glenn Maynard
On Sat, Jan 1, 2011 at 7:35 PM, Ryosuke Niwa rn...@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

Re: [whatwg] Low Memory Event

2011-01-01 Thread Charles Pritchard
On 1/1/2011 4:48 PM, Glenn Maynard wrote: On Sat, Jan 1, 2011 at 7:35 PM, Ryosuke Niwarn...@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

Re: [whatwg] Low Memory Event

2011-01-01 Thread Charles Pritchard
On 1/1/2011 4:07 PM, Glenn Maynard wrote: On Sat, Jan 1, 2011 at 5:04 PM, Charles Pritchardch...@jumis.com wrote: The separation of Mobile and Desktop seems arbitrary, in terms of specs: if it's useful on the mobile, why would it not be useful on the desktop? It's the same concept, a memory

Re: [whatwg] Low Memory Event

2011-01-01 Thread Kornel Lesiński
On Sun, 02 Jan 2011 00:53:48 -, Charles Pritchard ch...@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

Re: [whatwg] Low Memory Event

2011-01-01 Thread Roger Hågensen
On 2011-01-02 03:27, Kornel Lesiński wrote: On Sun, 02 Jan 2011 00:53:48 -, Charles Pritchard ch...@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.

Re: [whatwg] Low Memory Event

2011-01-01 Thread Glenn Maynard
On Sat, Jan 1, 2011 at 9:52 PM, Roger Hågensen resca...@emsai.net wrote: Charles, you initially said you where worried about this since you used undo buffers. Why not simply add undo buffers to the Canvas spec? That way the browser can start tossing away the oldest undo buffers automatically

[whatwg] Low Memory Event

2010-12-31 Thread Charles Pritchard
Regarding: http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2010-December/029575.html Web Applications may have wildly different use cases than hypertext documents. The issue at hand is attempting, in some part, to send a signal to the DOM that a low memory condition exists. This may not

Re: [whatwg] Low Memory Event

2010-12-31 Thread Boris Zbarsky
On 12/31/10 7:35 PM, Charles Pritchard wrote: If I were to receive an event, letting me know a low memory condition exists In many cases the only way a browser can determine that such a condition exists is by trying to allocate memory and having the allocation fail. At which point... it's

Re: [whatwg] Low Memory Event

2010-12-30 Thread Ian Hickson
On Fri, 24 Sep 2010, Charles Pritchard wrote: Do we have a route, or DOM events that signal when the device has a low memory condition? My computer is constantly running low in memory. Mozilla-apps (thunderbird) start hiding unneeded icons; Chrome betas just go ahead and crash the

Re: [whatwg] Low Memory Event

2010-09-28 Thread Dennis Joachimsthaler
Am 28.09.2010, 01:01 Uhr, schrieb timeless timel...@gmail.com: tl;dr of my previous post: it's impossible to know how much memory is available in the future. How much memory you're currently using is something that /could/ probably be provided in the near future. *However*, there might be a

Re: [whatwg] Low Memory Event

2010-09-28 Thread timeless
On 9/28/10, Rob Evans r...@mtn-i.com wrote: All good points. I think as we have moved away from simple web pages and really start to think about applications that are coded in js, many things previously the exclusive domain of desktop apps are more and more desirable for web apps.

Re: [whatwg] Low Memory Event

2010-09-27 Thread Rob Evans
Totally agree. +1! -Original Message- From: whatwg-boun...@lists.whatwg.org [mailto:whatwg-boun...@lists.whatwg.org] On Behalf Of Charles Pritchard Sent: 24 September 2010 21:57 To: whatwg@lists.whatwg.org Subject: [whatwg] Low Memory Event This is likely mentioned in the Device API

Re: [whatwg] Low Memory Event

2010-09-27 Thread timeless
what exactly do you intend to do if you get such a signal? In general, this is mostly a user problem. There are two basic cases: 1. user has one constrained device with one browser accessing a single web site (yours) with no other open applications. 2. user has a device with multiple open windows

Re: [whatwg] Low Memory Event

2010-09-27 Thread Rob Evans
I think one of the most useful things that a js script could know is how much memory is available and how much the current page is using. I'm writing a js game engine and knowing how much I can safely site in memory would be incredibly useful! That way I can do everything to maximize engine

Re: [whatwg] Low Memory Event

2010-09-27 Thread timeless
tl;dr of my previous post: it's impossible to know how much memory is available in the future. How much memory you're currently using is something that /could/ probably be provided in the near future. *However*, there might be a concern that this could be abused by attackers trying to figure out

Re: [whatwg] Low Memory Event

2010-09-27 Thread Rob Evans
All good points. I think as we have moved away from simple web pages and really start to think about applications that are coded in js, many things previously the exclusive domain of desktop apps are more and more desirable for web apps. I also think that a web page should be able to request

Re: [whatwg] Low Memory Event

2010-09-27 Thread Charles Pritchard
On 9/27/10 3:30 PM, Rob Evans wrote: I think one of the most useful things that a js script could know is how much memory is available and how much the current page is using. I'm writing a js game engine and knowing how much I can safely site in memory would be incredibly useful! On 27 Sep

Re: [whatwg] Low Memory Event

2010-09-27 Thread Rob Evans
Indeed, I think to start with this would be very useful. Even if no other info is presented, it would certainly help to mitigate any memory issues as much as possible. If nothing else the running script could act to reduce memory usage. On 28 Sep 2010 00:44, Charles Pritchard ch...@jumis.com

[whatwg] Low Memory Event

2010-09-24 Thread Charles Pritchard
This is likely mentioned in the Device API specs, or somewhere around there at the W3C: Do we have a route, or DOM events that signal when the device has a low memory condition? My computer is constantly running low in memory. Mozilla-apps (thunderbird) start hiding unneeded icons; Chrome