Description
This bug was originally reported by Ilia Kandrashou in https://groups.google.com/d/msg/golang-nuts/AVstzvKAej4/v1F_wreDCAAJ.
The test program at http://play.golang.org/p/zMHtw0-8Ph causes the process' RSS to slowly creep up over time. On a test amd64 machine running Linux 4.1.13-1-lts with GOMAXPROCS=16 at current master (b8b65c1), the RSS reaches 1GB after about 2 hours. According to gctrace=1, the live heap remains under 4MB the whole time (which it should):
...
gc 20460 @8457.750s 0%: 0.23+0+0+2.4+0.64 ms clock, 1.6+0+0+0.67/8.0/0+4.5 ms cpu, 4->4->0 MB, 5 MB goal, 16 P
gc 20461 @8458.117s 0%: 0.15+0+0+1.7+0.78 ms clock, 1.1+0+0+0.95/3.9/0+5.4 ms cpu, 4->4->0 MB, 5 MB goal, 16 P
gc 20462 @8458.477s 0%: 0.17+0+0+1.3+0.67 ms clock, 1.1+0+0+0.46/3.9/0+4.7 ms cpu, 4->4->0 MB, 5 MB goal, 16 P
...
The scavenger trace indicates that we're losing all of this memory in idle spans:
scvg59: inuse: 16, idle: 1018, sys: 1035, released: 0, consumed: 1035 (MB)
In Go 1.5.1, the RSS surpassed 1GB in less than 30 seconds, while the gctrace never reported a live heap over 22MB, so we've at least improved things. I haven't tested Go 1.5.2 yet, but according to the original report, the memory grows slowly but surely.