{"action":"created","issue":{"url":"https://api.github.com/repos/dotnet/coreclr/issues/10413","repository_url":"https://api.github.com/repos/dotnet/coreclr","labels_url":"https://api.github.com/repos/dotnet/coreclr/issues/10413/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/coreclr/issues/10413/comments","events_url":"https://api.github.com/repos/dotnet/coreclr/issues/10413/events","html_url":"https://github.com/dotnet/coreclr/pull/10413","id":216358516,"number":10413,"title":"Add heuristic to trigger GC to finalize dead threads and clean up han…","user":{"login":"kouvel","id":13499639,"avatar_url":"https://avatars2.githubusercontent.com/u/13499639?v=3","gravatar_id":"","url":"https://api.github.com/users/kouvel","html_url":"https://github.com/kouvel","followers_url":"https://api.github.com/users/kouvel/followers","following_url":"https://api.github.com/users/kouvel/following{/other_user}","gists_url":"https://api.github.com/users/kouvel/gists{/gist_id}","starred_url":"https://api.github.com/users/kouvel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kouvel/subscriptions","organizations_url":"https://api.github.com/users/kouvel/orgs","repos_url":"https://api.github.com/users/kouvel/repos","events_url":"https://api.github.com/users/kouvel/events{/privacy}","received_events_url":"https://api.github.com/users/kouvel/received_events","type":"User","site_admin":false},"labels":[{"id":197462704,"url":"https://api.github.com/repos/dotnet/coreclr/labels/cla-already-signed","name":"cla-already-signed","color":"009800","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2017-03-23T09:16:33Z","updated_at":"2017-03-24T12:07:33Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/dotnet/coreclr/pulls/10413","html_url":"https://github.com/dotnet/coreclr/pull/10413","diff_url":"https://github.com/dotnet/coreclr/pull/10413.diff","patch_url":"https://github.com/dotnet/coreclr/pull/10413.patch"},"body":"…dles and memory\r\n\r\nA thread that is started allocates some handles in Thread::AllocHandles(). After it terminates, the managed thread object needs to be collected by a GC for the handles to be released. Some applications that are mostly idle but have a timer ticking periodically will cause a thread pool thread to be created on each tick, since the thread pool preserves threads for a maximum of 20 seconds currently. Over time the number of handles accumulates to a high value. Thread creation adds some memory pressure, but that does not force a GC until a sufficiently large handle count, and for some mostly idle apps, that can be very long. The same issue arises with directly starting threads as well.\r\n\r\nFixes #6602:\r\n- Track a dead thread count separately from the current dead thread count. This is the count that will contribute to triggering a GC, once it reaches a threshold. The count is tracked separately so that it may be reset to zero when a max-generation GC occurs, preventing dead threads that survive a GC due to references from contributing to triggering a GC again in this fashion.\r\n- If the count exceeds a threshold, enumerate dead threads to see which GC generation the corresponding managed thread objects are in. If the duration of time since the last GC of the desired generation also exceeds a threshold, trigger a preferably non-blocking GC on the finalizer thread.\r\n- Removed a couple of handles and some code paths specific to user-requested thread suspension, which is not supported on CoreCLR"},"comment":{"url":"https://api.github.com/repos/dotnet/coreclr/issues/comments/289006202","html_url":"https://github.com/dotnet/coreclr/pull/10413#issuecomment-289006202","issue_url":"https://api.github.com/repos/dotnet/coreclr/issues/10413","id":289006202,"user":{"login":"kouvel","id":13499639,"avatar_url":"https://avatars2.githubusercontent.com/u/13499639?v=3","gravatar_id":"","url":"https://api.github.com/users/kouvel","html_url":"https://github.com/kouvel","followers_url":"https://api.github.com/users/kouvel/followers","following_url":"https://api.github.com/users/kouvel/following{/other_user}","gists_url":"https://api.github.com/users/kouvel/gists{/gist_id}","starred_url":"https://api.github.com/users/kouvel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kouvel/subscriptions","organizations_url":"https://api.github.com/users/kouvel/orgs","repos_url":"https://api.github.com/users/kouvel/repos","events_url":"https://api.github.com/users/kouvel/events{/privacy}","received_events_url":"https://api.github.com/users/kouvel/received_events","type":"User","site_admin":false},"created_at":"2017-03-24T12:07:33Z","updated_at":"2017-03-24T12:07:33Z","body":"Updated commit description"}}
{"actor":{"display_login":"kouvel"}}