On Jul 17, 2006, at 1:44 PM, Carlos Santiago wrote:
I have made test of perfomance exactly using different versions of
JVM (since 1.3 up to 1.6).
The test is inspired in the article of Matt Love in http://
www.ddj.com/dept/java/188700760 (for example).
I am not convinced this test will tell you anything of value. You are
taking unrealistic code and seeing what is done with it. The code is
unrealistic in doing one single thing a very large number of times.
The jvm handles this unrealistic code either well or badly and you
look at the numbers and go, ah, see the jvm handles this unrealistic
badly or well.
Uh, ok. But what does it do with realistic code?
If you want to measure gc performance then measure that, I have done
so before, but with real code I use daily, or almost daily.
Turn on verbose gc, or profile memory usage.
For verbose gc you can accumulate the information and analyze that.
Something like....
public int handled(String line) {
if (!line.startsWith("[GC")) return 0;
// if (!connected) return TailLoggerFilter.CONSUMED; // If we don't
handle it then ignore it
if (line.indexOf("->") == -1) return TailLoggerFilter.CONSUMED; //
Not sure how to parse yet
if (!inited) init();
num_of_gcs++;
long now = System.currentTimeMillis();
tot_elapsed = now - wall_clock_in;
line = line.substring(line.indexOf(" ")+1);
int memin = new Integer(line.substring(0,line.indexOf
("K"))).intValue();
line = line.substring(line.indexOf("K")+3);
int memot = new Integer(line.substring(0,line.indexOf
("K"))).intValue();
tot_freed += memot - memin;
line = line.substring(line.indexOf(", ")+2);
float duration = new Float(line.substring(0,9)).floatValue();
if (duration < gc_min) gc_min = duration;
else if (duration > gc_max) gc_max = duration;
long elapsed = now - last;
if (elapsed < gap_min) gap_min = elapsed;
else if (elapsed > gap_max) gap_max = elapsed;
if (elapsed < 2000) { // continued interval?
currintv_num++;
if (now - currintv_start > interval_max) interval_max = now -
currintv_start;
if (currintv_num > interval_max_num) interval_max_num = currintv_num;
}
else {
currintv_num = 1;
currintv_start = now;
}
last = now;
return TailLoggerFilter.CONSUMED;
}
Actually I sort of liked the interval idea where you track more
intense periods of consecutive gc's. But maybe thats just me, I like
that sort of thing.
But it gives you an idea of whether or not a lot of gc is being done.
If that gc is taking a lot of time. About how long between gc's.
Things like that which more directly measure gc. Or so I thought.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden
This email sent to email@hidden