• John Graham-Cumming's avatar
    runtime: implement runtime.SysUnused on FreeBSD · 314fd624
    John Graham-Cumming authored
    madvise was missing so implement it in assembler. This change
    needs to be extended to the other BSD variantes (Net and Open)
    
    Without this change the scavenger will attempt to pass memory back
    to the operating system when it has become idle, but the memory is
    not returned and for long running Go processes the total memory used
    can grow until OOM occurs.
    
    I have only been able to test the code on FreeBSD AMD64. The ARM
    platforms needs testing.
    
    R=golang-dev, mikioh.mikioh, dave, jgc, minux.ma
    CC=golang-dev
    https://golang.org/cl/6850081
    314fd624
mem_freebsd.c 1.72 KB