A computer configured as a Java virtual machine, the Java virtual machine comprising: a first portion of memory including a cluster of Java object representations (202, 204, 206, 208) which are sequentially represented inside the virtual machine, wherein each of said Java object representations consists of: a first reference to an internal class representation of a class associated with a Java object, and a second reference to instance fields associated with said Java object; a second portion of memory including: internal class representations of Java classes associated with said first references, and instance fields of Java objects referenced by said second references, wherein said plurality of Java object representations have the same size; wherein said first reference is a direct reference to said internal class representation of said Java object; and wherein the computer is further configured to perform the steps of: sequentially reading by said virtual machine at runtime said cluster of Java object representations; determining by said virtual machine at runtime during garbage collection whether Java objects or Java classes are to be identified; using said second references of said cluster during garbage collection to mark memory addresses that correspond to Java objects when said determining determines that Java objects are to be identified; and using one or more of said first references of said cluster during garbage collection to mark memory addresses that correspond to Java classes when said determining determines that Java classes are to be identified. a first portion of memory including a cluster of Java object representations (202, 204, 206, 208) which are sequentially represented inside the virtual machine, wherein each of said Java object representations consists of: a first reference to an internal class representation of a class associated with a Java object, and a second reference to instance fields associated with said Java object; a first reference to an internal class representation of a class associated with a Java object, and a second reference to instance fields associated with said Java object; a second portion of memory including: internal class representations of Java classes associated with said first references, and instance fields of Java objects referenced by said second references, internal class representations of Java classes associated with said first references, and instance fields of Java objects referenced by said second references, wherein said plurality of Java object representations have the same size; wherein said first reference is a direct reference to said internal class representation of said Java object; and wherein the computer is further configured to perform the steps of: sequentially reading by said virtual machine at runtime said cluster of Java object representations; determining by said virtual machine at runtime during garbage collection whether Java objects or Java classes are to be identified; using said second references of said cluster during garbage collection to mark memory addresses that correspond to Java objects when said determining determines that Java objects are to be identified; and using one or more of said first references of said cluster during garbage collection to mark memory addresses that correspond to Java classes when said determining determines that Java classes are to be identified. sequentially reading by said virtual machine at runtime said cluster of Java object representations; determining by said virtual machine at runtime during garbage collection whether Java objects or Java classes are to be identified; using said second references of said cluster during garbage collection to mark memory addresses that correspond to Java objects when said determining determines that Java objects are to be identified; and using one or more of said first references of said cluster during garbage collection to mark memory addresses that correspond to Java classes when said determining determines that Java classes are to be identified.