{"push_id":1296672382,"size":1,"distinct_size":1,"ref":"refs/heads/master","head":"9980b70cb460f27907a003674ab1b9bea24a847c","before":"0cd3ecb016e0c3f0656877a20ca37eabe4fd0f8f","commits":[{"sha":"9980b70cb460f27907a003674ab1b9bea24a847c","author":{"name":"Josh Bleecher Snyder","email":"ff3b63923c772c177a8220d1d1461f9401b867dd@gmail.com"},"message":"runtime: limit the number of map overflow buckets\n\nConsider repeatedly adding many items to a map\nand then deleting them all, as in #16070. The map\nitself doesn't need to grow above the high water\nmark of number of items. However, due to random\ncollisions, the map can accumulate overflow\nbuckets.\n\nPrior to this CL, those overflow buckets were\nnever removed, which led to a slow memory leak.\n\nThe problem with removing overflow buckets is\niterators. The obvious approach is to repack\nkeys and values and eliminate unused overflow\nbuckets. However, keys, values, and overflow\nbuckets cannot be manipulated without disrupting\niterators.\n\nThis CL takes a different approach, which is to\nreuse the existing map growth mechanism,\nwhich is well established, well tested, and\nsafe in the presence of iterators.\nWhen a map has accumulated enough overflow buckets\nwe trigger map growth, but grow into a map of the\nsame size as before. The old overflow buckets will\nbe left behind for garbage collection.\n\nFor the code in #16070, instead of climbing\n(very slowly) forever, memory usage now cycles\nbetween 264mb and 483mb every 15 minutes or so.\n\nTo avoid increasing the size of maps,\nthe overflow bucket counter is only 16 bits.\nFor large maps, the counter is incremented\nstochastically.\n\nFixes #16070\n\nChange-Id: If551d77613ec6836907efca58bda3deee304297e\nReviewed-on: https://go-review.googlesource.com/25049\nRun-TryBot: Josh Bleecher Snyder <josharian@gmail.com>\nTryBot-Result: Gobot Gobot <gobot@golang.org>\nReviewed-by: Keith Randall <khr@golang.org>","distinct":true,"url":"https://api.github.com/repos/Llewellynvdm/go/commits/9980b70cb460f27907a003674ab1b9bea24a847c"}]}
{"actor":{"display_login":"Llewellynvdm"}}