]> Cypherpunks repositories - gostls13.git/commit
runtime/race: lazily allocate shadow memory
authorDmitriy Vyukov <dvyukov@google.com>
Wed, 7 Nov 2012 08:48:58 +0000 (12:48 +0400)
committerDmitriy Vyukov <dvyukov@google.com>
Wed, 7 Nov 2012 08:48:58 +0000 (12:48 +0400)
commit1a19f01a683f8c62b7bd5f843a2e1b7ed6449542
tree3d07d992836a4d8d298ba7ed9cad25bfd1e9098e
parenta3a7244779066ba639e9c61d4b351800a9cb77f6
runtime/race: lazily allocate shadow memory
Currently race detector runtime maps shadow memory eagerly at process startup.
It works poorly on Windows, because Windows requires reservation in swap file
(especially problematic if several Go program runs at the same, each consuming GBs
of memory).
With this change race detector maps shadow memory lazily, so Go runtime must notify
about all new heap memory.
It will help with Windows port, but also eliminates scary 16TB virtual mememory
consumption in top output (which sometimes confuses some monitoring scripts).

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6811085
src/pkg/runtime/malloc.goc
src/pkg/runtime/race.c
src/pkg/runtime/race.h
src/pkg/runtime/race/race.go
src/pkg/runtime/race/race_darwin_amd64.syso
src/pkg/runtime/race/race_linux_amd64.syso
src/pkg/runtime/race0.c