[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Public WebGL] [Typed Array] ArrayBuffer Method Request - Dispose
Yep, the problem isn't memory not being released, the problem is memory being released "at some point in the future" by the GC. As mentioned previously, array buffers can consume large amounts of system memory especially when working with WebGL and Audio Context at an advanced level, and an application cannot currently dispose of any array buffers even when it knows those array buffers will no longer be needed.
What we are looking at right now is large amounts of system memory being used when there is absolutely no reason for it to be in use. If a game, for example, no longer needs the assets for "level one" when "level two" is loaded into memory, the game should be able to dispose of the level one assets before the level two assets are loaded into memory.
We most definitely need some kind of memory management control with these new APIs. Adding a dispose() method to array buffers will be an ideal solution for most use cases.
On 25 February 2013 19:00, Jussi Kalliokoski <firstname.lastname@example.org>
On Mon, Feb 25, 2013 at 1:32 PM, Gregg Tavares <email@example.com> wrote:
The problem isn't that the memory isn't released, quite the contrary, the problem is that the memory is often released at the wrong time, e.g. in the middle of filling a buffer with audio (if you fail at filling the buffer quickly enough, your sounds won't make it to the speakers) or during a drawing operation, causing jitter in the frame rate. Having a manual dispose function to free the buffer would for example let the developer free the memory for example after the buffer is filled with audio, thus reducing the risk of artifacts in the sound.