{"action":"created","issue":{"url":"https://api.github.com/repos/golang/go/issues/22350","repository_url":"https://api.github.com/repos/golang/go","labels_url":"https://api.github.com/repos/golang/go/issues/22350/labels{/name}","comments_url":"https://api.github.com/repos/golang/go/issues/22350/comments","events_url":"https://api.github.com/repos/golang/go/issues/22350/events","html_url":"https://github.com/golang/go/issues/22350","id":267050842,"number":22350,"title":"cmd/compile: compiler can unexpectedly preserve memory","user":{"login":"zardlee1937","id":5220708,"avatar_url":"https://avatars1.githubusercontent.com/u/5220708?v=4","gravatar_id":"","url":"https://api.github.com/users/zardlee1937","html_url":"https://github.com/zardlee1937","followers_url":"https://api.github.com/users/zardlee1937/followers","following_url":"https://api.github.com/users/zardlee1937/following{/other_user}","gists_url":"https://api.github.com/users/zardlee1937/gists{/gist_id}","starred_url":"https://api.github.com/users/zardlee1937/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zardlee1937/subscriptions","organizations_url":"https://api.github.com/users/zardlee1937/orgs","repos_url":"https://api.github.com/users/zardlee1937/repos","events_url":"https://api.github.com/users/zardlee1937/events{/privacy}","received_events_url":"https://api.github.com/users/zardlee1937/received_events","type":"User","site_admin":false},"labels":[{"id":373402289,"url":"https://api.github.com/repos/golang/go/labels/NeedsInvestigation","name":"NeedsInvestigation","color":"ededed","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/golang/go/milestones/6","html_url":"https://github.com/golang/go/milestone/6","labels_url":"https://api.github.com/repos/golang/go/milestones/6/labels","id":1055141,"number":6,"title":"Unplanned","description":"No plan to fix in any specific release.\r\n","creator":{"login":"rsc","id":104030,"avatar_url":"https://avatars1.githubusercontent.com/u/104030?v=4","gravatar_id":"","url":"https://api.github.com/users/rsc","html_url":"https://github.com/rsc","followers_url":"https://api.github.com/users/rsc/followers","following_url":"https://api.github.com/users/rsc/following{/other_user}","gists_url":"https://api.github.com/users/rsc/gists{/gist_id}","starred_url":"https://api.github.com/users/rsc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rsc/subscriptions","organizations_url":"https://api.github.com/users/rsc/orgs","repos_url":"https://api.github.com/users/rsc/repos","events_url":"https://api.github.com/users/rsc/events{/privacy}","received_events_url":"https://api.github.com/users/rsc/received_events","type":"User","site_admin":false},"open_issues":1107,"closed_issues":840,"state":"open","created_at":"2015-04-06T20:47:19Z","updated_at":"2017-10-30T20:48:06Z","due_on":"2099-12-31T08:00:00Z","closed_at":null},"comments":56,"created_at":"2017-10-20T03:09:37Z","updated_at":"2017-10-30T22:50:29Z","closed_at":null,"author_association":"NONE","body":"Please answer these questions before submitting your issue. Thanks!\r\n\r\n\r\n### What version of Go are you using (`go version`)?\r\ngo1.9.1\r\n\r\n### Does this issue reproduce with the latest release?\r\nyes. every release.\r\n\r\n### What operating system and processor architecture are you using (`go env`)?\r\nGOARCH=amd64\r\nGOBIN=C:\\Go\\bin\r\nGOEXE=.exe\r\nGOHOSTARCH=amd64\r\nGOHOSTOS=windows\r\nGOOS=windows\r\nGOPATH=D:\\golang\r\nGORACE=\r\nGOROOT=C:\\Go\r\nGOTOOLDIR=C:\\Go\\pkg\\tool\\windows_amd64\r\nGCCGO=gccgo\r\nCC=gcc\r\nGOGCCFLAGS=-m64 -fmessage-length=0 -fdebug-prefix-map=C:\\Users\\zhalei\\AppData\\Local\\Temp\\go-build309785515=/tmp/go-build -gno-record-gcc-switches\r\nCXX=g++\r\nCGO_ENABLED=1\r\nPKG_CONFIG=pkg-config\r\nCGO_CFLAGS=-g -O2\r\nCGO_CPPFLAGS=\r\nCGO_CXXFLAGS=-g -O2\r\nCGO_FFLAGS=-g -O2\r\nCGO_LDFLAGS=-g -O2\r\n\r\n### What did you do?\r\nWrite codes for test GC of golang.\r\nHere is what i use to test.\r\n\r\n\tpackage main\r\n\r\n\timport \"fmt\"\r\n\timport \"time\"\r\n\r\n\ttype Node struct {\r\n\t\tnext     *Node\r\n\t\tpayload  [64]byte\r\n\t}\r\n\r\n\tfunc main() {\r\n\t\troot := new(Node)\r\n\t\tcurr := root\r\n\t\ti := 0\r\n\t\t\r\n\t\tlastTime := time.Now()\r\n\t\tfor {\r\n\t\t\tcurrTime := time.Now()\r\n\t\t\telapsed := currTime.Sub(lastTime)\r\n\t\t\tlastTime = currTime\r\n\t\t\t// 10ms = 10000000ns\r\n\t\t\tif elapsed > 10000000 {\r\n\t\t\t\tfmt.Println(\"StopTime:\", elapsed)\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tcurr.next = new(Node)\r\n\t\t\tcurr = curr.next\r\n\t\t\t\r\n\t\t\ti++\r\n\t\t\t//3000 nodes max\r\n\t\t\tif i >= 3000 {\r\n\t\t\t\ti = 0\r\n\t\t\t\troot = curr\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\r\n### What did you expect to see?\r\nthe program run well.\r\n\r\n### What did you see instead?\r\nmemory never be released until everything stop work. and then, i take my `pc` power off. -_-\r\n"},"comment":{"url":"https://api.github.com/repos/golang/go/issues/comments/340608340","html_url":"https://github.com/golang/go/issues/22350#issuecomment-340608340","issue_url":"https://api.github.com/repos/golang/go/issues/22350","id":340608340,"user":{"login":"ianlancetaylor","id":3194333,"avatar_url":"https://avatars2.githubusercontent.com/u/3194333?v=4","gravatar_id":"","url":"https://api.github.com/users/ianlancetaylor","html_url":"https://github.com/ianlancetaylor","followers_url":"https://api.github.com/users/ianlancetaylor/followers","following_url":"https://api.github.com/users/ianlancetaylor/following{/other_user}","gists_url":"https://api.github.com/users/ianlancetaylor/gists{/gist_id}","starred_url":"https://api.github.com/users/ianlancetaylor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ianlancetaylor/subscriptions","organizations_url":"https://api.github.com/users/ianlancetaylor/orgs","repos_url":"https://api.github.com/users/ianlancetaylor/repos","events_url":"https://api.github.com/users/ianlancetaylor/events{/privacy}","received_events_url":"https://api.github.com/users/ianlancetaylor/received_events","type":"User","site_admin":false},"created_at":"2017-10-30T22:50:29Z","updated_at":"2017-10-30T22:50:29Z","author_association":"CONTRIBUTOR","body":"@cznic \r\n\r\n> This issue is about a particular setup where heap allocations are not transitively reachable from any root observable by the program but still not eligible for collection.\r\n\r\nAs you know, the current GC treats the entire stack as a root.  So by that definition the heap allocation is transitively reachable from a root.\r\n\r\nI assume that what you are trying to get at is that we shouldn't treat the entire stack as a root.  That seems similar to what @mdempsky suggested above:\r\n\r\n> Partial GC scanning of stacks. Instead of recording stack autotmps' liveness in stackmaps, we could leave it up to GC to identify them and trace them out. This would require the compiler to generate additional stackmap-like data structures, and additional GC algorithms for scanning stacks."}}
{"actor":{"display_login":"ianlancetaylor"}}