{"action":"created","issue":{"url":"https://api.github.com/repos/kangyabo/KnowledgeMap/issues/2","repository_url":"https://api.github.com/repos/kangyabo/KnowledgeMap","labels_url":"https://api.github.com/repos/kangyabo/KnowledgeMap/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/kangyabo/KnowledgeMap/issues/2/comments","events_url":"https://api.github.com/repos/kangyabo/KnowledgeMap/issues/2/events","html_url":"https://github.com/kangyabo/KnowledgeMap/issues/2","id":191942019,"number":2,"title":"jdk内存回收","user":{"login":"kangyabo","id":16273139,"avatar_url":"https://avatars.githubusercontent.com/u/16273139?v=3","gravatar_id":"","url":"https://api.github.com/users/kangyabo","html_url":"https://github.com/kangyabo","followers_url":"https://api.github.com/users/kangyabo/followers","following_url":"https://api.github.com/users/kangyabo/following{/other_user}","gists_url":"https://api.github.com/users/kangyabo/gists{/gist_id}","starred_url":"https://api.github.com/users/kangyabo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kangyabo/subscriptions","organizations_url":"https://api.github.com/users/kangyabo/orgs","repos_url":"https://api.github.com/users/kangyabo/repos","events_url":"https://api.github.com/users/kangyabo/events{/privacy}","received_events_url":"https://api.github.com/users/kangyabo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-11-28T08:08:37Z","updated_at":"2016-11-30T04:54:10Z","closed_at":null,"body":""},"comment":{"url":"https://api.github.com/repos/kangyabo/KnowledgeMap/issues/comments/263782918","html_url":"https://github.com/kangyabo/KnowledgeMap/issues/2#issuecomment-263782918","issue_url":"https://api.github.com/repos/kangyabo/KnowledgeMap/issues/2","id":263782918,"user":{"login":"kangyabo","id":16273139,"avatar_url":"https://avatars.githubusercontent.com/u/16273139?v=3","gravatar_id":"","url":"https://api.github.com/users/kangyabo","html_url":"https://github.com/kangyabo","followers_url":"https://api.github.com/users/kangyabo/followers","following_url":"https://api.github.com/users/kangyabo/following{/other_user}","gists_url":"https://api.github.com/users/kangyabo/gists{/gist_id}","starred_url":"https://api.github.com/users/kangyabo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kangyabo/subscriptions","organizations_url":"https://api.github.com/users/kangyabo/orgs","repos_url":"https://api.github.com/users/kangyabo/repos","events_url":"https://api.github.com/users/kangyabo/events{/privacy}","received_events_url":"https://api.github.com/users/kangyabo/received_events","type":"User","site_admin":false},"created_at":"2016-11-30T04:54:10Z","updated_at":"2016-11-30T04:54:10Z","body":"## 判断对象存活算法\r\n* 引用计数算法，每当有一个地方引用它时，计数器值就加1，引用失效时，计数器值减1；任何时刻计数器为0的对象即使不可能再被使用的。但是很难解决对象之间相互循环引用的问题。\r\n\r\n* 可达性分析算法，通过一些列的GC Roots作为起点，从这些节点开始向下搜索，走过的路径称为引用链，当一个对象到GC Roots没有任何引用链相连时，证明此对象不可用。java默认使用这种算法。可作为GC Roots的对象包括下面几种：\r\n    * 虚拟机栈中引用的对象。\r\n    * 方法区中静态属性引用的对象。\r\n    * 方法区中常量引用的对象\r\n    * 本地方法栈中JNI（即一般说的Native方法）引用的对象。\r\n\r\n## Java四种引用类型：\r\n* 强引用，类似“Object obj = new Object()”，只要强引用还在，垃圾收集器永远不会回收掉被引用的对象。\r\n* 软引用，将要发生内存溢出异常前，会回收。\r\n* 弱引用，下一次GC发生时被回收。\r\n* 虚引用，一个对象是否有虚引用不会影响生存时间，也无法通过虚引用取得对象实例，对一个对象设置虚引用目的是在这个对象被回收时收到一个系统通知。"}}
{"actor":{"display_login":"kangyabo"}}