On Sun, Jun 19, 2022 at 12:57 AM Vitaly Isaev <
vitaly...@gmail.com> wrote:
>
> Ian, thank you for the clarification, but what if this happens on Linux with Go >= 1.16 (where MADV_DONTNEED is default)?
> воскресенье, 19 июня 2022 г. в 03:02:54 UTC+3, Ian Lance Taylor:
>>
>> On Sat, Jun 18, 2022 at 6:35 AM Vitaly Isaev <
vitaly...@gmail.com> wrote:
>> >
>> > Hi everyone, I've read the thread
https://github.com/golang/go/issues/33376,
>> > but still I can't figure out what does it mean when HeapReleased value is decreasing.
>> > When the Go runtime returns the memory to the OS, isn't it an irreversible process? So why does this indicator have to go down?
>> >
>> > Or should we interpret HeapReleased as an amount of HeapIdle virtual memory, that is not backed by physical memory?
>> >
>> > Could anyone please elaborate on this.
>>
>> HeapReleased goes up when the runtime tells the OS that it no longer
>> needs the memory. On Linux this is done via madvise(MADV_FREE).
>> HeapReleased goes down when the runtime decides that it wants to use
>> the memory again. Linux permits ths for MADV_FREE pages, it's just
>> that the pages may or may be zeroed.
>>
>> In other words, no, in general returning memory to the OS is not an
>> irreversible process.
>>
>> Ian
>
> You received this message because you are subscribed to the Google Groups "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to