JVM Optionen für Debuggingzwecke

Hallo,
Beispielausgaben:

DebugDummy:
Java:
package de.tutorials;

public class DebugDummy {

    /**
     * @param args
     */
    public static void main(String[] args) {
        // TODO Auto-generated method stub
        int i = 4711;
        System.out.println("1");
        System.out.println("2");
        String s = "foo";
        System.out.println("3");
        System.out.println("4");
        System.out.println("5");
        System.out.println("6");
        System.out.println("7");
        
    }

}

Code:
C:\Dokumente und Einstellungen\Thomas.Darimont\workspace-3.3.1.1-aop\de.tutorials.training>java -XX:-TraceClassLoading  -cp bin de.tutorials.DebugDummy
1
2
3
4
5
6
7

Mit -XX:-Option schaltet man die option aus,
mit -XX:+Option schaltet man die option an,

Code:
C:\Dokumente und Einstellungen\Thomas.Darimont\workspace-3.3.1.1-aop\de.tutorials.training>java -XX:+TraceClassLoading  -cp bin de.tutorials.DebugDummy
[Loaded java.lang.Object from shared objects file]
[Loaded java.io.Serializable from shared objects file]
[Loaded java.lang.Comparable from shared objects file]
[Loaded java.lang.CharSequence from shared objects file]
[Loaded java.lang.String from shared objects file]
[Loaded java.lang.reflect.GenericDeclaration from shared objects file]
[Loaded java.lang.reflect.Type from shared objects file]
[Loaded java.lang.reflect.AnnotatedElement from shared objects file]
[Loaded java.lang.Class from shared objects file]
[Loaded java.lang.Cloneable from shared objects file]
[Loaded java.lang.ClassLoader from shared objects file]
[Loaded java.lang.System from shared objects file]
[Loaded java.lang.Throwable from shared objects file]
[Loaded java.lang.Error from shared objects file]
....
[Loaded de.tutorials.DebugDummy from file:/C:/Dokumente%20und%20Einstellungen/Thomas.Darimont/workspace-3.3.1.1-aop/de.tutorials.training/bin/]
1
2
3
4
5
6
7
[Loaded java.util.AbstractList$Itr from shared objects file]
[Loaded java.util.IdentityHashMap$KeySet from shared objects file]
[Loaded java.util.IdentityHashMap$IdentityHashMapIterator from shared objects file]
[Loaded java.util.IdentityHashMap$KeyIterator from shared objects file]
[Loaded java.io.DeleteOnExitHook from shared objects file]
[Loaded java.util.LinkedHashSet from shared objects file]
[Loaded java.util.HashMap$KeySet from shared objects file]
[Loaded java.util.LinkedHashMap$LinkedHashIterator from shared objects file]
[Loaded java.util.LinkedHashMap$KeyIterator from shared objects file]

Hier können wir schön sehen wie die Klassen (in der Client) JVM aus dem Shared Classfile Image das mit Java 5 eingeführt wurde geladen werden.

Startet man das ganze nun mal mit der Server JVM:
Code:
C:\Dokumente und Einstellungen\Thomas.Darimont\workspace-3.3.1.1-aop\de.tutorials.training>java -server -XX:+TraceClassLoading  -cp bin de.tutorials.DebugDummy
[Opened C:\Programme\Java\jdk1.6.0_04\jre\lib\rt.jar]
[Loaded java.lang.Object from C:\Programme\Java\jdk1.6.0_04\jre\lib\rt.jar]
[Loaded java.io.Serializable from C:\Programme\Java\jdk1.6.0_04\jre\lib\rt.jar]
[Loaded java.lang.Comparable from C:\Programme\Java\jdk1.6.0_04\jre\lib\rt.jar]
[Loaded java.lang.CharSequence from C:\Programme\Java\jdk1.6.0_04\jre\lib\rt.jar]
[Loaded java.lang.String from C:\Programme\Java\jdk1.6.0_04\jre\lib\rt.jar]
[Loaded java.lang.reflect.GenericDeclaration from C:\Programme\Java\jdk1.6.0_04\jre\lib\rt.jar]
[Loaded java.lang.reflect.Type from C:\Programme\Java\jdk1.6.0_04\jre\lib\rt.jar]
[Loaded java.lang.reflect.AnnotatedElement from C:\Programme\Java\jdk1.6.0_04\jre\lib\rt.jar]
[Loaded java.lang.Class from C:\Programme\Java\jdk1.6.0_04\jre\lib\rt.jar]
[Loaded java.lang.Cloneable from C:\Programme\Java\jdk1.6.0_04\jre\lib\rt.jar]
[Loaded java.lang.ClassLoader from C:\Programme\Java\jdk1.6.0_04\jre\lib\rt.jar]
[Loaded java.lang.System from C:\Programme\Java\jdk1.6.0_04\jre\lib\rt.jar]
[Loaded java.lang.Throwable from C:\Programme\Java\jdk1.6.0_04\jre\lib\rt.jar]
...
[Loaded de.tutorials.DebugDummy from file:/C:/Dokumente%20und%20Einstellungen/Thomas.Darimont/workspace-3.3.1.1-aop/de.tutorials.training/bin/]
1
2
3
4
5
6
7
[Loaded java.util.AbstractList$Itr from C:\Programme\Java\jdk1.6.0_04\jre\lib\rt.jar]
[Loaded java.util.IdentityHashMap$KeySet from C:\Programme\Java\jdk1.6.0_04\jre\lib\rt.jar]
[Loaded java.util.IdentityHashMap$IdentityHashMapIterator from C:\Programme\Java\jdk1.6.0_04\jre\lib\rt.jar]
[Loaded java.util.IdentityHashMap$KeyIterator from C:\Programme\Java\jdk1.6.0_04\jre\lib\rt.jar]
[Loaded java.io.DeleteOnExitHook from C:\Programme\Java\jdk1.6.0_04\jre\lib\rt.jar]
[Loaded java.util.LinkedHashSet from C:\Programme\Java\jdk1.6.0_04\jre\lib\rt.jar]
[Loaded java.util.HashMap$KeySet from C:\Programme\Java\jdk1.6.0_04\jre\lib\rt.jar]
[Loaded java.util.LinkedHashMap$LinkedHashIterator from C:\Programme\Java\jdk1.6.0_04\jre\lib\rt.jar]
[Loaded java.util.LinkedHashMap$KeyIterator from C:\Programme\Java\jdk1.6.0_04\jre\lib\rt.jar]

So sieht man, dass dabei der Shared Class Image nicht scheinbar verwendet wird. Das bedeutet, dass das ClassLoading in der Server JVM ein wenig langsamer ist als innerhalb der Client JVM. Kann das jemand bestätigen?

Gruß Tom
 
Zurück