{"action":"created","issue":{"url":"https://api.github.com/repos/dotnet/coreclr/issues/6769","repository_url":"https://api.github.com/repos/dotnet/coreclr","labels_url":"https://api.github.com/repos/dotnet/coreclr/issues/6769/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/coreclr/issues/6769/comments","events_url":"https://api.github.com/repos/dotnet/coreclr/issues/6769/events","html_url":"https://github.com/dotnet/coreclr/pull/6769","id":171651173,"number":6769,"title":"Jitted Code Dropping Feature implemented","user":{"login":"sergign60","id":172260,"avatar_url":"https://avatars.githubusercontent.com/u/172260?v=3","gravatar_id":"","url":"https://api.github.com/users/sergign60","html_url":"https://github.com/sergign60","followers_url":"https://api.github.com/users/sergign60/followers","following_url":"https://api.github.com/users/sergign60/following{/other_user}","gists_url":"https://api.github.com/users/sergign60/gists{/gist_id}","starred_url":"https://api.github.com/users/sergign60/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sergign60/subscriptions","organizations_url":"https://api.github.com/users/sergign60/orgs","repos_url":"https://api.github.com/users/sergign60/repos","events_url":"https://api.github.com/users/sergign60/events{/privacy}","received_events_url":"https://api.github.com/users/sergign60/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/dotnet/coreclr/labels/cla-signed","name":"cla-signed","color":"207de5"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-08-17T13:00:15Z","updated_at":"2016-08-17T19:15:04Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/dotnet/coreclr/pulls/6769","html_url":"https://github.com/dotnet/coreclr/pull/6769","diff_url":"https://github.com/dotnet/coreclr/pull/6769.diff","patch_url":"https://github.com/dotnet/coreclr/pull/6769.patch"},"body":"The given pull request proposes a way for resolving issue \"Jitted Code Dropping Support\" #6757\r\nIts distinctive features and algorithm are:\r\n\r\n1. All its code is under #if defined(FEATURE_JIT_DROPPING) and doesn't mess up with other code\r\n\r\n2. This feature is working only if the options INTERNAL_JitDropEnabled != 0 and  INTERNAL_JitDropMemThreshold > 0\r\n\r\n3. Jitted code can be dropped only for methods that are not Dynamic or FCall\r\n\r\n4. If the size of the generated native code exceeds the value of INTERNAL_JitDropMethodSizeThreshold this code is placed in the special heap code list.  Each heap block in this list stores the code for only one method and has the sufficient size for the code of a method aligned to 4K. The pointers to such methods are stored in the \"CalledMethods\" hash map.\r\n\r\n5. If the entrypoint of a method is backpatched this method is excluded from the \"CalledMethods\" hash map.\r\n\r\n6. When the total size of the generated native code exceeds the value of  INTERNAL_JitDropMemThreshold option, the execution of the program is stopped and stack frames for all the threads are inspected and pointers to methods being executed are stored in the \"ExecutedMethods\" hash map\r\n\r\n7. The code for all the methods from the \"CalledMethods\" that are not in the \"ExecutedMethods\" is dropped. (All heap blocks for these methods are set in the initial state and can be reused for newly compiled methods,  pointers to the code for non-executed methods are set to NULL).\r\n\r\n8. The coreclr code with this feature is built by the option\r\n \r\n./build.sh cmakeargs -DFEATURE_JIT_DROPPING=true"},"comment":{"url":"https://api.github.com/repos/dotnet/coreclr/issues/comments/240516932","html_url":"https://github.com/dotnet/coreclr/pull/6769#issuecomment-240516932","issue_url":"https://api.github.com/repos/dotnet/coreclr/issues/6769","id":240516932,"user":{"login":"adityamandaleeka","id":219224,"avatar_url":"https://avatars.githubusercontent.com/u/219224?v=3","gravatar_id":"","url":"https://api.github.com/users/adityamandaleeka","html_url":"https://github.com/adityamandaleeka","followers_url":"https://api.github.com/users/adityamandaleeka/followers","following_url":"https://api.github.com/users/adityamandaleeka/following{/other_user}","gists_url":"https://api.github.com/users/adityamandaleeka/gists{/gist_id}","starred_url":"https://api.github.com/users/adityamandaleeka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adityamandaleeka/subscriptions","organizations_url":"https://api.github.com/users/adityamandaleeka/orgs","repos_url":"https://api.github.com/users/adityamandaleeka/repos","events_url":"https://api.github.com/users/adityamandaleeka/events{/privacy}","received_events_url":"https://api.github.com/users/adityamandaleeka/received_events","type":"User","site_admin":false},"created_at":"2016-08-17T19:15:04Z","updated_at":"2016-08-17T19:15:04Z","body":"Thanks for sending this PR @sergign60. I haven't reviewed all of the code yet but I think this can be useful. I wanted to also mention that we should think about how this will affect diagnostic tools now that there can be different methods at the same address at different times. It's not an unsolvable problem, but I just wanted to bring it up so that it's considered."}}
{"actor":{"display_login":"adityamandaleeka"}}