Steve Fink (2014-11-04T20:45:15.000Z)
On 11/04/2014 11:08 AM, Brendan Eich wrote:
> Steve Fink wrote:
>> On a related note, I*would*  like to have some way of getting the OS to
>> decommit memory. Seehttps://bugzilla.mozilla.org/show_bug.cgi?id=855669
>> (start reading at about comment 22) for our discussion and attempt at
>> this, which looks like it mysteriously trailed off this lastMarch.
>> Theoretically, the above loop could also trigger a decommit, but I think
>> it's too much to expect the engine to guess when that's going to be a
>> good idea. On the other hand, from a spec POV it's unobservable
>> behavior, which makes it weird.
>
> ArrayBuffer.transfer
> (https://gist.github.com/andhow/95fb9e49996615764eff) is an ES7 stage
> 0 proposal, needs to move to stage 1 soon. It enables decommitting
> memory.

I'm not sure we're talking about the same thing. I'm talking about what
would be madvise(MADV_DONTNEED) on POSIX or VirtualAlloc(MEM_RESET) on
Windows. Er... actually, I think it would be MEM_RESET followed by
MEM_COMMIT to get the zero-filling while still releasing the physical pages.

Unless there's some tricky way of using ArrayBuffer.transfer to signal
that memory can be decommitted, but I don't see it.
d at domenic.me (2014-11-18T23:20:40.634Z)
On 11/04/2014 11:08 AM, Brendan Eich wrote:

> ArrayBuffer.transfer
> (https://gist.github.com/andhow/95fb9e49996615764eff) is an ES7 stage
> 0 proposal, needs to move to stage 1 soon. It enables decommitting
> memory.

I'm not sure we're talking about the same thing. I'm talking about what
would be madvise(MADV_DONTNEED) on POSIX or VirtualAlloc(MEM_RESET) on
Windows. Er... actually, I think it would be MEM_RESET followed by
MEM_COMMIT to get the zero-filling while still releasing the physical pages.

Unless there's some tricky way of using ArrayBuffer.transfer to signal
that memory can be decommitted, but I don't see it.