[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Public WebGL] Lifetime of WebGL objects in Firefox and Webkit



On Tue, Jun 28, 2011 at 8:16 PM, Gregg Tavares (wrk) <gman@google.com> wrote:
_javascript_ GC is tied to _javascript_, not to OpenGL. That's my point. When _javascript_ runs out of memory it runs the GC. When OpenGL runs out of memory.......Nothing.

GC happens all the time, not merely when under memory pressure. If a browser runs my 8GB system out of memory before it tries to GC, something has gone catastrophically wrong.

If you want a solution fine. My point was the thing you were suggesting (weak references on WebGL resources from the WebGLContext) is not a solution. You want a solution then argue for something that would actually solve the problem (like the 3 suggestions I gave)

It's a solution to the problem of objects being kept alive forever if the user drops all references to it. It's a straightforward reference leak, which prevents the object from being collected at all, for the entire lifetime of the context. It isn't a matter of recovering from allocation failures, or of guaranteeing that objects will be released "in time" for something else, but of simply allowing object cleanup to happen in the normal course of GC.

--
Glenn Maynard