{"id":303,"date":"2012-02-09T01:26:27","date_gmt":"2012-02-08T17:26:27","guid":{"rendered":"http:\/\/guoh.ai\/lifelog\/?p=303"},"modified":"2013-06-24T14:58:03","modified_gmt":"2013-06-24T06:58:03","slug":"java-knowledge-skeleton","status":"publish","type":"post","link":"https:\/\/guoh.ai\/lifelog\/2012\/02\/java-knowledge-skeleton\/","title":{"rendered":"Java\u77e5\u8bc6\u8109\u7edc"},"content":{"rendered":"<p>Java\u77e5\u8bc6\u5e9e\u5927\u800c\u590d\u6742\uff0c\u6240\u4ee5\u6709\u5fc5\u8981\u6807\u8bb0\u4e0b\u81ea\u5df1\u5b66\u8fc7\u54ea\u4e9b\u4e1c\u897f\uff0c\u8ba9\u81ea\u5df1\u66f4\u6e05\u695a<\/p>\n<p><strong>Java Language Partition<\/strong><\/p>\n<p><strong>I \u57fa\u672c\u6570\u636e\u7c7b\u578b\u5f15\u7528\u7c7b\u578b<\/strong><\/p>\n<p>String<br \/>\n\u5e38\u91cf\u6c60(Constant Pool)\u5b58\u5728\u4e8e.class\u6587\u4ef6\u4e2d\uff0c\u8fd0\u884c\u65f6\u88ab\u52a0\u8f7d\uff0c\u53ef\u4ee5\u6269\u5145\uff0cString.intern()\u65b9\u6cd5\u5c31\u53ef\u4ee5\u6269\u5145\u5e38\u91cf\u6c60<\/p>\n<p>String\u53d8\u91cf\u662f\u6709\u957f\u5ea6\u9650\u5236\u7684\uff0c\u6700\u5927\u957f\u5ea6\u4e3aInteger.MAX_VALUE<br \/>\n\u4f46String\u5e38\u91cf(string literals)\u7684\u6700\u5927\u957f\u5ea6\u5374\u4e0d\u4e3a\u8fd9\u4e48\u591a\uff0c\u53c2\u8003\u5730<a href=\"http:\/\/java.sun.com\/docs\/books\/jvms\/second_edition\/html\/ClassFile.doc.html#7963\">\u8fd9<\/a>(http:\/\/java.sun.com\/docs\/books\/jvms\/second_edition\/html\/ClassFile.doc.html#7963)\u548c<a href=\"http:\/\/java.sun.com\/docs\/books\/jvms\/second_edition\/html\/ClassFile.doc.html#29297\">\u8fd9<\/a><\/p>\n<p>\u5173\u4e8e<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">String s = new String(&quot;hello&quot;);<\/pre>\n<p>\u521b\u5efa\u51e0\u4e2a\u5bf9\u8c61\u7684\u95ee\u9898\uff0c\u53c2\u89c1<a href=\"http:\/\/www.iteye.com\/topic\/774673\">\u8fd9\u91cc<\/a><\/p>\n<p>\u4f1a\u6709\u5b57\u7b26\u4e32\u5bf9\u8c61\u53ea\u5728Heap\u4e2d\uff0c\u4f46\u662fConstant Pool\u4e2d\u4e0d\u5b58\u5728\u5bf9\u5e94\u7684\u5b57\u9762\u8868\u793a\u5417\uff1fConstant Pool\u4e2d\u7684\u5185\u5bb9\u4f1a\u4e0d\u4f1a\u88abGC\uff1f<\/p>\n<p><strong>II \u5e38\u7528\u5bf9\u8c61<\/strong><\/p>\n<p>III<\/p>\n<p>IV<\/p>\n<p>V<\/p>\n<p>VI<\/p>\n<p><strong>VII \u4e00\u4e9b\u9519\u8bef\u6216\u8005\u5f02\u5e38<\/strong><br \/>\njava.lang.OutOfMemoryError: Requested array size exceeds VM limit<\/p>\n<p>VIII<\/p>\n<p><strong>Java Virtual Machine Partition<\/strong><\/p>\n<p><strong>I Feature<\/strong><br \/>\nStack based<br \/>\nSymbolic reference<br \/>\nGarbage collection<br \/>\nExplicitly defining the primitive data type<br \/>\nNetwork byte order<\/p>\n<p><strong>II Class Format<\/strong><br \/>\nMethods in Java are restricted to 64k<br \/>\nhttp:\/\/bugs.sun.com\/bugdatabase\/view_bug.do?bug_id=4309152<\/p>\n<p><strong>III GC<\/strong><br \/>\n\u6839\u96c6\u5408\u662f\u4ec0\u4e48\uff0c\u600e\u4e48\u786e\u5b9a\u6839\u96c6\u5408\uff1f<br \/>\nHotSpot\u865a\u62df\u673a\u4e2d\u5783\u573e\u5bf9\u8c61\u7684\u626b\u63cf\u662f\u91c7\u7528\u7684\u8def\u5f84\u641c\u7d22\u65b9\u6cd5\uff0c\u4ece\u6839\u96c6\u5408\u5f00\u59cb\u6ca1\u6709\u8def\u5f84\u53ef\u5230\u8fbe\u7684\u88ab\u8ba4\u4e3a\u662f\u5783\u573e\u5bf9\u8c61\uff0c\u53ef\u4ee5\u56de\u6536<br \/>\n\u6839\u96c6\u5408\u5305\u62ec\uff0c\u6808\u5e27\u5f53\u4e2d<\/p>\n<p><strong>IV Instruction Set<\/strong><br \/>\ninvokeinterface: Invokes an interface method<br \/>\ninvokespecial: Invokes an initializer, private method, or superclass method<br \/>\ninvokestatic: Invokes static methods<br \/>\ninvokevirtual: Invokes instance methods<\/p>\n<p>PS.<br \/>\nupdate 2012-02-09 \u5199\u7684\u8fd9\u4e2a\u7834\u73a9\u610f\u5728\u8349\u7a3f\u7bb1\u8eba\u4e866\u4e2a\u6708\u4e86\uff0c\u53d1\u51fa\u6765\u8fb9\u770b\uff0c\u8fb9\u8865\u5145\u5427\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Java\u77e5\u8bc6\u5e9e\u5927\u800c\u590d\u6742\uff0c\u6240\u4ee5\u6709\u5fc5\u8981\u6807\u8bb0\u4e0b\u81ea\u5df1\u5b66\u8fc7\u54ea\u4e9b\u4e1c\u897f\uff0c\u8ba9\u81ea\u5df1\u66f4\u6e05\u695a Java Language Partition I \u57fa\u672c\u6570\u636e\u7c7b\u578b\u5f15\u7528\u7c7b\u578b String \u5e38\u91cf\u6c60(Constant Pool)\u5b58\u5728\u4e8e.class\u6587\u4ef6\u4e2d\uff0c\u8fd0\u884c\u65f6\u88ab\u52a0\u8f7d\uff0c\u53ef\u4ee5\u6269\u5145\uff0cString.intern()\u65b9\u6cd5\u5c31\u53ef\u4ee5\u6269\u5145\u5e38\u91cf\u6c60 String\u53d8\u91cf\u662f\u6709\u957f\u5ea6\u9650\u5236\u7684\uff0c\u6700\u5927\u957f\u5ea6\u4e3aInteger.MAX_VALUE \u4f46String\u5e38\u91cf(string literals)\u7684\u6700\u5927\u957f\u5ea6\u5374\u4e0d\u4e3a\u8fd9\u4e48\u591a\uff0c\u53c2\u8003\u5730\u8fd9(http:\/\/java.sun.com\/docs\/books\/jvms\/second_edition\/html\/ClassFile.doc.html#7963)\u548c\u8fd9 \u5173\u4e8e String s = new String(&quot;hello&quot;); \u521b\u5efa\u51e0\u4e2a\u5bf9\u8c61\u7684\u95ee\u9898\uff0c\u53c2\u89c1\u8fd9\u91cc \u4f1a\u6709\u5b57\u7b26\u4e32\u5bf9\u8c61\u53ea\u5728Heap\u4e2d\uff0c\u4f46\u662fConstant Pool\u4e2d\u4e0d\u5b58\u5728\u5bf9\u5e94\u7684\u5b57\u9762\u8868\u793a\u5417\uff1fConstant Pool\u4e2d\u7684\u5185\u5bb9\u4f1a\u4e0d\u4f1a\u88abGC\uff1f II \u5e38\u7528\u5bf9\u8c61 III IV V VI VII \u4e00\u4e9b\u9519\u8bef\u6216\u8005\u5f02\u5e38 java.lang.OutOfMemoryError: Requested array size exceeds VM limit VIII Java Virtual Machine Partition I Feature Stack based Symbolic reference Garbage collection Explicitly defining the primitive data &hellip; <a href=\"https:\/\/guoh.ai\/lifelog\/2012\/02\/java-knowledge-skeleton\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Java\u77e5\u8bc6\u8109\u7edc<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_gfmr_meta_descriptions":[],"_gfmr_multilingual_taxonomy_terms":[],"footnotes":""},"categories":[5,4,33,8],"tags":[18],"class_list":["post-303","post","type-post","status-publish","format-standard","hentry","category-cs","category-java","category-jvm","category-paste","tag-concurrency"],"_links":{"self":[{"href":"https:\/\/guoh.ai\/lifelog\/wp-json\/wp\/v2\/posts\/303","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/guoh.ai\/lifelog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/guoh.ai\/lifelog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/guoh.ai\/lifelog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/guoh.ai\/lifelog\/wp-json\/wp\/v2\/comments?post=303"}],"version-history":[{"count":19,"href":"https:\/\/guoh.ai\/lifelog\/wp-json\/wp\/v2\/posts\/303\/revisions"}],"predecessor-version":[{"id":604,"href":"https:\/\/guoh.ai\/lifelog\/wp-json\/wp\/v2\/posts\/303\/revisions\/604"}],"wp:attachment":[{"href":"https:\/\/guoh.ai\/lifelog\/wp-json\/wp\/v2\/media?parent=303"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/guoh.ai\/lifelog\/wp-json\/wp\/v2\/categories?post=303"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/guoh.ai\/lifelog\/wp-json\/wp\/v2\/tags?post=303"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}