As far as I know, using the common sense while developing your Java applications is the bes measure. Here are few tips that I learned:
1. Get a profiler: a profiler adds up the cumulative execution time in each method of your code. Tools with good profilers let you drill down graphically, and find the coding sections that are requiring the most time. Everybody should have some kind of profiler (OptimizeIt, JProbe).
2. Stop memory leaks: Java virtual machines automate memory allocation, and use a technique called reachable objects to do garbage collection. An object is reachable if you can access it directly from some thread, or through a reference in another reachable object. When an object with a long life span keeps an unwanted reference to an unused object (like a static variable), you've got a leak. To solve memory leaks, you've got to be able to see the heap: the pool of all allocated objects. There's no good way to do so without a tool. Borland's Optimizeit Suite can help you with this.
3. Use a thred debugger to untangle your threads. Borland thread debugger is a good choice.
4. When you've finished developing and testing your code, recompile with compiler optimizations turned on (e.g., javac -O).
5. You can translate Java into C with this:
[http://www.webcity.co.jp/info/andoh/java/j2c.html]
and this:
[http://www.digiserve.com/nshaylor/jcc.html]
6. You should only use exceptions where you really need them.
7. The String concatenation operator + looks innocent but involves a lot of work: a new StringBuffer is created, the two arguments are added to it with append(), and the final result is converted back with a toString(). This costs both space and time.
8. Use classes from the Java API when they offer native machine performance that you can't match using Java. For example, arraycopy() is much faster than using a loop to copy an array of any significant size.
Here is also a link for u to chk out: [http://gee.cs.oswego.edu/dl/oosdw3/ch25.html]
On a high level you can use global register allocation. But I don't know much about it. Try searching on the net.