Sunday, May 31, 2009

JDK 1.6.0_14

Well it appears that this revision is not a one to ignore if you care about performance (and you have the guts of an early adapter:-) The "small" revision update is not small at all and contains 3 important performance improvements:
1. The long anticipated G1 garbage collector
2. Escape analysis
3. Compressed OOPs

I will elaborate on these features in my next posts.... for now you may look at http://java.sun.com/javase/6/webnotes/6u14.html

What does this say about JDK1.7 ? Down porting features before 1.7 is released...... makes you wonder is 1.7 going to be Sun's Vista?

Wednesday, May 27, 2009

BTrace the ultimate JVM probe

Hi,
I have been working with BTrace in the last few months and the more I use it the more I appreciate it. BTrace enables you to write a small java class that will instrument you java application on the fly and will give you ultimate flexibiliy to pin-point the requested information.
It can help in debugging/ profiling/ deadlock analysis and solving other stability problems
I am going to give a session 2.5 hours session on the 1/7 in Israel(Petah Tikva). Details will follow..... If you want to attend send me an email to haim.yadid@scalablej.com
Here is a tricky example which will help you identify where in the code a you write a certaion message to stdout..... enjoy!

package com.scalablej.btrace;

import com.sun.btrace.annotations.*;
import static com.sun.btrace.BTraceUtils.*;

@BTrace public class PrintlnLocator {
@OnMethod(
clazz = "java.io.PrintStream",
method = "println",
location = @Location(value = Kind.ENTRY))
public static void onPrint(Object a, String l) {
boolean b = compare(
get(field(classForName("java.lang.System"), "out")), a);
if (b) {
println(l);
jstack();
}
}

}