runtime: reduce arena size to 4MB on 64-bit Windows
runtime: reduce arena size to 4MB on 64-bit Windows

Currently, we use 64MB heap arenas on 64-bit platforms. This works
well on UNIX-like OSes because they treat untouched pages as
essentially free. However, on Windows, committed memory is charged
against a process whether or not it has demand-faulted physical pages
in. Hence, on Windows, even a process with a tiny heap will commit
64MB for one heap arena, plus another 32MB for the arena map. Things
are much worse under the race detector, which increases the heap
commitment by a factor of 5.5X, leading to 384MB of committed memory
at runtime init.

Fix this by reducing the heap arena size to 4MB on Windows.

To counterbalance the effect of increasing the arena map size by a
factor of 16, and to further reduce the impact of the commitment for
the arena map, we switch from a single entry L1 arena map to a 64
entry L1 arena map.

Compared to the original arena design, this slows down the
x/benchmarks garbage benchmark by 0.49% (the slow down of this commit
alone is 1.59%, but the previous commit bought us a 1% speed-up):

name                       old time/op  new time/op  delta
Garbage/benchmem-MB=64-12  2.28ms ± 1%  2.29ms ± 1%  +0.49%  (p=0.000 n=17+18)

(https://perf.golang.org/search?q=upload:20180223.1)

(This was measured on linux/amd64 by modifying its arena configuration
as above.)

Fixes #23900.

Change-Id: I6b7fa5ecebee2947bf20cfeb78c248809469c6b1
Reviewed-on: https://go-review.googlesource.com/96780
Run-TryBot: Austin Clements <7ea35d812706d9213868749011af1ed4fa2f6aa0@google.com>
TryBot-Result: Gobot Gobot <66cb808b70d30c07676d5e946fee83fd561249e5@golang.org>
Reviewed-by: Rick Hudson <838bd060584c511f21c75c69ea04b7b120d86af0@golang.org>

codestation/go,Cofyc/go,nawawi/go,akutz/go,cloudflare/go,nawawi/go,josharian/go,cloudflare/go,akutz/go,Cofyc/go,josharian/go,codestation/go,nawawi/go,codestation/go,josharian/go,CAFxX/go,akutz/go,nawawi/go,golang/go,Cofyc/go,josharian/go,Cofyc/go,akutz/go,codestation/go,golang/go,Cofyc/go,josharian/go,CAFxX/go,codestation/go,josharian/go,codestation/go,golang/go,CAFxX/go,CAFxX/go,cloudflare/go,nawawi/go,akutz/go,cloudflare/go,codestation/go,golang/go,Cofyc/go,akutz/go,josharian/go,akutz/go,cloudflare/go,CAFxX/go,nawawi/go,akutz/go,josharian/go,golang/go,codestation/go,nawawi/go,Cofyc/go,CAFxX/go,CAFxX/go,cloudflare/go,cloudflare/go,Cofyc/go,golang/go,nawawi/go,golang/go,cloudflare/go,CAFxX/go,golang/go