Java知识脉络

Java知识庞大而复杂,所以有必要标记下自己学过哪些东西,让自己更清楚

Java Language Partition

I 基本数据类型引用类型

String
常量池(Constant Pool)存在于.class文件中,运行时被加载,可以扩充,String.intern()方法就可以扩充常量池

String变量是有长度限制的,最大长度为Integer.MAX_VALUE
但String常量(string literals)的最大长度却不为这么多,参考地(http://java.sun.com/docs/books/jvms/second_edition/html/ClassFile.doc.html#7963)和

关于

String s = new String("hello");

创建几个对象的问题,参见这里

会有字符串对象只在Heap中,但是Constant Pool中不存在对应的字面表示吗?Constant Pool中的内容会不会被GC?

II 常用对象

III

IV

V

VI

VII 一些错误或者异常
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 type
Network byte order

II Class Format
Methods in Java are restricted to 64k
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4309152

III GC
根集合是什么,怎么确定根集合?
HotSpot虚拟机中垃圾对象的扫描是采用的路径搜索方法,从根集合开始没有路径可到达的被认为是垃圾对象,可以回收
根集合包括,栈帧当中

IV Instruction Set
invokeinterface: Invokes an interface method
invokespecial: Invokes an initializer, private method, or superclass method
invokestatic: Invokes static methods
invokevirtual: Invokes instance methods

PS.
update 2012-02-09 写的这个破玩意在草稿箱躺了6个月了,发出来边看,边补充吧。

JVM标记贴

    JVM参数

  • JMX参数
  • -Dcom.sun.management.jmxremote.port=1090
    -Dcom.sun.management.jmxremote.ssl=false
    -Dcom.sun.management.jmxremote.authenticate=false

  • 扩展参数
  • -XX:+PrintGC
    -XX:+PrintGCDetails
    -XX:+PrintGCTimeStamps 和PrintGC以及PrintGCDetails一起使用
    -Xloggc:gc.log

    -XX:+DoEscapeAnalysis
    -XX:+HeapDumpOnOutOfMemoryError