Showing posts from May, 2008

Debugging into Java core libraries with Eclipse

Unzip the jdk fileCreate a project and build the java sourceOpen the Eclipse project run dialog for the project you want to debug into the java source from
Click on the Classpath tabClick on the Bootstrap EntriesClick the Add Projects buttonAdd the java source projectClick on the Up/Down buttons to move the java source project above the JRE System Library (equivalent to -Xbootclasspath/p)Debug your project as normal and you will be able inspect variables as you step through the java core libraries
Alter the java source to add instrumentation for things like recording last mutator thread stack trace of Collections for debugging and discovering the source of ConcurrentModificationException, etc.


Random access of ZIP

TrueZip encapsulates random access, but only works with files


Perm generation memory space

Class information is stored in the perm generation. Also constant strings are stored there. Strings created dynamically in your application with String.intern() will also be stored in the perm generation. Additionally, the hotspot compiled code resides in the perm generation.

Class unloading: every instance has a reference to its class, and every class has a reference to its class loader, and every class loader has a reference to all the classes that it loaded. Usually if you want classes to get unloaded, you have to have thought about that beforehand and set up separate class loaders to allow for that.

you cannot change the configured sizes for the Perm generation during runtime.
The parameters for setting initial and max size are -XX:PermSize=xM and -XX:MaxPermSize=yM.

sub-area of the perm space, called the code cache
separate JVM parameter to also bump up the code cache size