]> Cypherpunks repositories - gostls13.git/commit
runtime: release unused memory to the OS.
authorSébastien Paolacci <sebastien.paolacci@gmail.com>
Thu, 16 Feb 2012 18:30:04 +0000 (13:30 -0500)
committerRuss Cox <rsc@golang.org>
Thu, 16 Feb 2012 18:30:04 +0000 (13:30 -0500)
commit5c598d3c9f0b9d78f92ffe1ab5a2365fe900c631
tree56aba77cf4a776ad909654548a6383ab19a0a08f
parent85d33918a0c4ad56b2f40b052963e2c1dafb7014
runtime: release unused memory to the OS.

Periodically browse MHeap's freelists for long unused spans and release them if any.

Current hardcoded settings:
        - GC is forced if none occured over the last 2 minutes.
        - spans are handed back after 5 minutes of uselessness.

SysUnused (for Unix) is a wrapper on madvise MADV_DONTNEED on Linux and MADV_FREE on BSDs.

R=rsc, dvyukov, remyoudompheng
CC=golang-dev
https://golang.org/cl/5451057
src/pkg/runtime/malloc.h
src/pkg/runtime/mem.go
src/pkg/runtime/mgc0.c
src/pkg/runtime/mheap.c
src/pkg/runtime/proc.c