Short summary: Escape analysis is not enabled by default in JDK 6, and it’s available only in server JVM Thus in order to enable Escape analysis, following parameters for java are required: [code] java -server -XX:+DoEscapeAnalysis [/code] So lets run run the test from the references… Test Program [code lang=”java”] package org.kari.test; public class LockTest…
Read moreTransparent compression in RMI
If very large objects are being transferred over RMI layer, then system must do lot of work not only in serialization of the objects, but also in the transfer itself. If RMI based communication is wanted to be used across WAN environment, 100Mbit datatransfer speed is simply not available everywhere. For example, ADSL subscription lines…
Read moreSpeed up Java2D (& Swing) in Linux
Using -Dsun.java2d.opengl=true as startup argument for java when starting application using Java2D heavily (well, basically any Swing application), it improves noticeably performance in Linux environment. Currently I’m experimenting following settings in my /etc/profile.local -file. [code] _JAVA_OPTIONS=’-Xverify:none -Dsun.java2d.opengl=true’ export _JAVA_OPTIONS [/code] (_JAVA_OPTIONS is magic environment variable which is used automatically by java). I tested performance by…
Read moreProfiling Webstart applications
Profiling of the applications launched via webstart may sound difficult, but in reality it isn’t. What you need is to have approriate profiler/debugger native libraries in LD_LIBRARY_PATH of the system (or equivalent), and then specifying necessary arguments for webstart (from command line) For example, using YourKit with Webstart: [code] javaws -J-agentlib:yjpagent=tracing http://example.com/example.jnlp [/code] Same approach…
Read moreJava SE 6 troubleshooting
Some interesting additional java parameters: B.1 HotSpot VM Command-Line Options – Troubleshooting Guide for Java SE 6 with HotSpot VM Option to automatically make memory dump when OutOfMemory occurs sounds rather interesting. These utilities, should exist in all java deployments: jps: List PIDs of java processes jmap: Make heap of java process (jmap -dump:format=b,file=test.hprof PID)…
Read moreModifying remote webstart launch file locally
It seems that it’s possible to save remote webstart file locally. And while still using remotely distributed jar files for the webstart, modify at least few webstart parameters in locally saved jnlp -file. However, this trick seems to work only with JDK5 version of webstart, not the one in JDK6. JDK6 seems to dutifully retrieve…
Read moreJDK 6…, improvement over JDK 5…, not
For example, following issues seem to be persistently existing: Bug ID: 6566201 JNLP ClassLoader performance degraded in 1.6 significantly for the signed(?) jar Bug ID: 6532373 xcb_xlib.c:50: xcb_xlib_unlock: Assertion ’c->xlib.lock’ failed. First issue means huge slow down in webstart application startup. When doing some profiling in webstart started application, it’s consuming huge amount of memory…
Read moreDetecting from where code is called
Detect if current piece of code is called by own classes: [code lang=”java”] /** * @return True if current execution points originates from own classes */ public static boolean isOwn() { StackTraceElement[] stack = Thread.currentThread().getStackTrace(); int len = stack.length; for (int i = 2; i < len; i++) { if (stack[i].getClassName().startsWith("org.kari.")) { return true; }...
Read more